TurboT
Convex Community3y ago
11 replies
Turbo

Complex Filtering

I'm a bit confused on how i should go about conditionally filtering my queries and filtering entries in general.

I have a table with two fields by which I want to filter the results. But the args i provide in the query function are optional.

Let's take the field "map" because that's the easiest to filter out of the two
In the image below i filter the returned documents. Is this an efficient way to filter queries?

I mean it works, but I do want to make it more efficient than to get everything and then filter, because who knows when the table could have thousands of entries, which as i understood from the indexing docs, does take longer to go through all the entries.
image.png
Was this page helpful?