LeodusL
Convex Community6mo ago
2 replies
Leodus

When I use a paginated query, is there a quick way to know the total count?

I am querying a large dataset, and I have filters based on many fields, some of them are user generated.
This means that there is no way to cache the filter result, because there could be an infinite amount of combinations.
Right now I need to use
.collect()
and count all the documents.
Is there a more efficient way of doing this?

(My database bandwidth is growing too fast)
Was this page helpful?