.neq?
In the docs I see
q.neq(l, r) l !== r
is a valid filter operator, but it doesnt seem to be working?
Error: [CONVEX Q(user:getThreads)] Uncaught TypeError: q.eq(...).eq(...).neq is not a function
6 Replies
ah, i see now that i was inside the filter section, not withIndex.
ah, i guss its not possible..
on an index, it's basically the "same" as page through everything and just filter. since you're not using the index to "skip" any records
You can do two queries with
.lt
and .gt
in the index. And for things like "undefined" or "null" you can find all values as .gt("maybeExists", null)
There's a sort order for all types it turns out, so if your field has strings and objects and numbers, they'll all show up as either .gt
or .lte
some value (currently). This is either a feature or confusing depending who you ask š
haha, i see. thank you for the explanations...i do have a follow up question that's somewhat related...
with each successive pagination page we fetch, how are the results of the previous batches mixed together?
ā¢ is it concatenated? as in,
pageOneResults.concat(pageTwoResults)
ā¢ or is the entire list "resorted"
[...pageOneResults, ...pageTwoResults].sort()
Pagination pages are concatenated, but the results are still in sorted order. Could you give an example where re-sorting might make a difference?
Pasting a part of our direct message conversation here
i have my own sorting algorithm and want to apply that to the results from the paginated query (the entire combined pages/batches) or be able to incorporate my own algorithm after the withIndex.
I made a separate support ticket "Pagination features" related to this