KonradK
Convex Community2y ago
8 replies
Konrad

Querying Multiple Documents by IDs in Convex

I'm currently working on an application where I have a list of document IDs and I need to fetch their corresponding data from Convex. I am considering a few approaches and would appreciate some help on what is the best approach.

1. Is there a way to use the filter method to directly query for a set of IDs in one go, something akin to an IN clause in SQL? For example, can I pass an array of IDs to filter or use a combination of filter and or to achieve this? Or maybe with some other method?
2. If such an array-based filtering is not supported, would it be more efficient to:

(a)Retrieve all documents and filter them on the client-side using JavaScript? ()
(b)Make separate queries for each ID?
(c) Some other pattern
Was this page helpful?