PouchDB Live Query Plugin
Provide a view which keeps itself up to date by listening to the changes feed.
⚠️ Very alpha.
Installation
pouchdb-live-query is hosted on npm.
Node
Install via npm install pouchdb-live-query
var PouchDB = PouchDB
Browser
Use the browserified build.
Usage
var db = 'mydb' db
db.liveQuery(fun, [options])
Similar to db.query
.
Options
fun
: The name of a view in an existing design document, e.g.'mydesigndoc/myview'
.options.include_docs
: Include the document in each row in the doc field.options.descending
: Reverse the order of the output rows.options.startkey
andoptions.endkey
: Return only rows between these.
Whats Missing
callback
- Currently works only with promises.options.key
- Key exact match is ignored on view update.options.reduce
- No reduce support at all. Just to mention some...
Tests
npm test