-
Notifications
You must be signed in to change notification settings - Fork 70
Closed
Labels
TPAC2024Topic for discussion at TPAC 2024Topic for discussion at TPAC 2024feature requestneeds-prqueries
Milestone
Description
In PouchDB we're implementing a "batched cursor" using getAll()
and getAllKeys()
(pouchdb/pouchdb#6060, pouchdb/pouchdb#6031). E.g. it can be used to paginate through an objectStore n
records at a time, given a lower bound and optional upper bound.
Unfortunately we are only able to do this in ascending order, since in descending order the limit
will always give us the first n
records instead of the last n
records. it would be nice if we could do something like:
objectStore.getAllKeys(keyRange, batchSize, 'prev').onsuccess = ...
objectStore.getAll(keyRange, batchSize, 'prev').onsuccess = ...
... where the batchSize
would fetch the highest n
records instead of the lowest. The downside of this method is that it's tricky to feature-detect unless you insert some dummy data and then try to fetch it, although maybe there's a more clever way.
dagalti, masterkidan, janispritzkau, belvederef, nestor-alcantara and 8 morepubkey
Metadata
Metadata
Assignees
Labels
TPAC2024Topic for discussion at TPAC 2024Topic for discussion at TPAC 2024feature requestneeds-prqueries