Multi-value indexes
Especially for paginated queries, supporting multiple values for the same field in an index would be make certain queries a lot less complicated to write. The pattern of paging through n pages from the client to gather a complete page does work, but it's fiddly to implement and, on a lesser note, typically multiplies function calls.
Example, I want to paginate through high priority records in a table. Priority is a number, and high priority is anything above 10. I either have to do excess pagination calls on the frontend to build up a page, or add a "high priority" field to the table that provides a boolean for whether the priority field qualifies as "high".
I don't honestly know what the API for that would look like. Maybe each field name string in the index definition can be optionally replaced with a config object.
5 Replies
Does this work?
A general multi-value index filter could be possible, but it may be tricky to come up with an intuitive syntax. We haven't seen a lot of examples that require it, so having more details of your use-case might help
Totally forgot we can include a range in the index - this does work for my use case 👍
And if you want them with highest priority first,
.order("desc")
If you want to order by creationTime though, you're out of luck without doing the complicated thing
Not a blocker for now 👍