Mark LM
Convex Community5mo ago
1 reply
Mark L

Filters | Convex Developer Hub

How do you do both pagination and filtering on an array in convex? The docs example say to just filter them after the ctx.db.query, but I don't see how this could work with paginated queries.

https://docs.convex.dev/database/reading-data/filters#advanced-filtering-techniques

I think this is a pretty common useCase I have a table with tagIds and I want to find all results that has a specific tagId paginated, so I get e.g. 50 at a time. Does anyone know how to filter arrays in paginated queries?

There will be >10k results and this will be the #1 called query in my app, so I do want to make it more efficient. The docs in several places suggest sorting in JS is not efficient when there's 1,000's of rows.
Filter documents in Convex queries
Filters | Convex Developer Hub
Was this page helpful?