Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmacartney committed Dec 2, 2024
1 parent d571aed commit 4b38aa5
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,10 @@ import { mutation as rawMutation } from "./_generated/server";
import { TableAggregate } from "@convex-dev/aggregate";

const aggregate = new TableAggregate<{
Namespace: undefined;
Key: number;
DataModel: DataModel;
TableName: "mytable";
}>(components.aggregate, {
namespace: (doc) => undefined, // disable namespacing.
sortKey: (doc) => doc._creationTime, // Allows querying across time ranges.
sumValue: (doc) => doc.value, // The value to be used in `.sum` calculations.
});
Expand Down Expand Up @@ -308,12 +306,10 @@ If you don't need the ordering, partitioning, or summing behavior of

```ts
const randomize = new TableAggregate<{
Namespace: undefined;
Key: null;
DataModel: DataModel;
TableName: "mytable";
}>(components.aggregate, {
namespace: (doc) => undefined,
sortKey: (doc) => null,
});
```
Expand Down Expand Up @@ -397,7 +393,6 @@ import { DirectAggregate } from "@convex-dev/aggregate";
// Note the `id` should be unique to be a tie-breaker in case two data points
// have the same key.
const aggregate = new DirectAggregate<{
Namespace: undefined;
Key: number;
Id: string;
}>(components.aggregate);
Expand Down

0 comments on commit 4b38aa5

Please sign in to comment.