pouchdb-upsert-bulk
Upsert bulk plugin for PouchDB
db//=> {rows: [{doc: {_id: '1', _rev: '1', prop: 'foo', other: true}}]} // Mergedb //=> {rows: [{doc: {_id: '1', _rev: '2', prop: 'bar', other: true}}]} // Replacedb //=> {rows: [{doc: {_id: '1', _rev: '3', prop: 'bar'}}]}
Note only tested in Node >=6.
Usage
npm install --save pouchdb-upsert-bulk
PouchDB
API
upsertBulk(<docs> [, opts])
Perform a bulk upsert (update or insert) operation. Inserts new docs. Merges existing docs.
opts.replace
: replaces existing docs
Future work
- Browser support
- pouchdb-upsert-like diff functions
Author
© 2016 Tom Vincent git@tlvince.com (https://tlvince.com)
License
Released under the MIT license.