0.0.3 • Published 9 years ago

pouch-random-update v0.0.3

Weekly downloads
5
License
ISC
Repository
github
Last release
9 years ago

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);
});
0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago

0.0.0

9 years ago