How to get results from paginate Queries?
I want to paginate the results of my query, I was unable to find any examples in the docs so can someone please help me with it?
The query I want to paginate -
I want to get all the results of a specific chatId till we have reached the end, how can I get the results in here?
2 Replies
You'll use
.paginate()
instead of .take()
in your query, and you'll need to loop over ctx.runQuery()
to get all of the pages. Check out the pagination docs here: https://docs.convex.dev/database/paginationPaginated Queries | Convex Developer Hub
Load paginated queries.
Ahh got it, just had to scroll all the way to the bottom to check how to use
cursor
. Thanks tho.