Nishil Faldu
Nishil Faldu5d ago

Table Aggregate

https://github.com/get-convex/aggregate/blob/main/example/convex/leaderboard.ts - trying to follow this example here
const aggregateScoreByUser = new TableAggregate<{
Key: [string, number];
DataModel: DataModel;
TableName: "leaderboard";
}>(components.aggregateScoreByUser, {
sortKey: (doc) => [doc.name, doc.score],
sumValue: (doc) => doc.score,
});
const aggregateScoreByUser = new TableAggregate<{
Key: [string, number];
DataModel: DataModel;
TableName: "leaderboard";
}>(components.aggregateScoreByUser, {
sortKey: (doc) => [doc.name, doc.score],
sumValue: (doc) => doc.score,
});
how does one get the name of the individual with the highest aggregate score? apologies if I missed something in the docs
GitHub
aggregate/example/convex/leaderboard.ts at main · get-convex/aggreg...
Component for aggregating counts and sums of Convex documents - get-convex/aggregate
1 Reply
Convex Bot
Convex Bot5d ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!

Did you find this page helpful?