pouch-random-update

0.0.3 • Public • Published

pouch random update

Update a random doc in pouchdb.

api

update(db, docs [, updateFn])

install

$ npm install pouch-random-update

Example

var Pouch = require('pouchdb');
var update = require('pouch-random-update');
 
var pouch = new Pouch('some-db');
pouch.allDocs({
  include_docs: true
}).then(function(resp) {
  var docs = resp.rows.map(function(row) {
    return row.doc;
  });
  setInterval(function() {
    // default updateFn returns promise from pouch.put()
    update(db, docs).then(function(resp) {
      console.log(resp);
    });
  }, 3000);
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.3
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.3
    1
  • 0.0.2
    0
  • 0.0.1
    0
  • 0.0.0
    0

Package Sidebar

Install

npm i pouch-random-update

Weekly Downloads

1

Version

0.0.3

License

ISC

Last publish

Collaborators

  • nichoth