apache / apache/pouchdb

pouchdb-find does not generate or use bookmarks

Open
#8,497 6 comments 0 reactions 0 assignees View on GitHub
stale
Dominant language
JavaScript
Stars
17.6k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

### Issue

CouchDB uses bookmarks to allow users to paginate through the results of Mango queries. PouchDB neither generates bookmarks nor interacts with them when provided. *This means you cannot paginate through Mango query results with PouchDB unless using the HTTP adapter.*

### Info

- Environment: N/A
- Platform: N/A
- Adapter: all non-http adapters
- Server: N/A

### Reproduce

```js
const PouchDB = require('pouchdb')
PouchDB.plugin(require('pouchdb-find'))

Promise.resolve().then(async () => {
const db = new PouchDB('repro')
await db.post({ hello: 'world' })
await db.post({ hello: 'world' })
await db.createIndex({ index: { fields: ['hello'] } })
const results = await db.find({ selector: { hello: 'world' }, limit: 1 })
console.log(results.bookmark) // undefined
await db.destroy() // clean up
})
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.