[w3c/IndexedDB] Add descending order for getAll() and getAllKeys() (#130)

In PouchDB we're implementing a "batched cursor" using `getAll()` and `getAllKeys()` (https://github.com/pouchdb/pouchdb/pull/6060, https://github.com/pouchdb/pouchdb/pull/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:

```js
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.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/130

Received on Friday, 23 December 2016 00:42:04 UTC