filter index based on multiple possible values?
pending. due to lots of users, and lots of posts per user, we have an index set up to index posts by ["userId", "status"]. therefore, we query like so:now consider we want to allow querying based off multiple
status values. lets, select all posts made by a given user that are pending or in_progress. we would have to write the following:but what if we wanted to make list of statuses an argument, that could be passed from the FE (i.e. a user filters their own posts down to any combination of
pending, in_progress completed or cancelledin order to do this, we currently have to use the convex-helper
filter or a basic TS array-filter after we query the results from the index. but cannot actively filter out within withIndex , which defeats the purpose of a by_userId_status index. it would look something like this:how might we achieve the desired performance with the approach of using arguments to index off of?
