Patolord
Patolord2mo ago

@jamwt I also have a function that

@jamwt I also have a function that returns player position based on score on the leaderboard ie #320 for field score 2313 points, is there a way to do that without fulltable scan to count players above?
2 Replies
sujayakar
sujayakar2mo ago
hey! you can do this with the aggregates component. check out https://github.com/get-convex/aggregate?tab=readme-ov-file#installation and the usage section for how to set it up. we have a leaderboard example written up in the repo here: https://github.com/get-convex/aggregate/blob/main/example/convex/leaderboard.ts this will compute the position of a given score efficiently without a full table scan
Patolord
PatolordOP2mo ago
Awesome i will check it out thanks!!

Did you find this page helpful?