Paginated indexed query with multiple index choices?
contacts table, and need to retrieve contacts by the region they're in. The table contains a region field (an ID from the regions table) and has an index on that field. When finding contacts matching a single region, both normal and paginated queries using this index are working fine.Yesterday I learned that the app needs to support collecting contacts matching multiple regions. With my normal queries, modifying them to support this requirement was pretty easy. I just ran multiple queries in a loop—one matching each region ID—appending the results of each to an array of type
Doc<"contacts">, then returned that array.The snag that I'm hitting is with the paginated query. I can't think of a way to alter it similarly so that its results contain contacts matching all passed region IDs. While I could skip the index and just filter manually, there will eventually be thousands of contacts in this table, so I'd like to find a more optimized solution if at all possible.
