Budibase is an open-source low-code platform for creating internal apps in minutes. Supports PostgreSQL, MySQL, MSSQL, MongoDB, Rest API, Docker, K8s 🚀
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Budibase Helm Bot cc8a16a1e8 Helm Release: 1.2.36 4 years ago
..
node_modules Helm Release: 1.2.36 4 years ago
test Helm Release: 1.2.36 4 years ago
.jshintrc Helm Release: 1.2.36 4 years ago
.npmignore Helm Release: 1.2.36 4 years ago
eventProxy.js Helm Release: 1.2.36 4 years ago
index.js Helm Release: 1.2.36 4 years ago
package.json Helm Release: 1.2.36 4 years ago
readable.js Helm Release: 1.2.36 4 years ago
readme.md Helm Release: 1.2.36 4 years ago
writable.js Helm Release: 1.2.36 4 years ago

readme.md

Pouch Stream

Streaming plugin for PouchDB

npm install pouch-stream
PouchDB.plugin(require('pouch-stream'));

Writable

note: the docs you give it can have _ids's or not and it will do post or put depending, you can also pass an array for bulk docs, it also takes an option object which will be passed verbatem to bulkDocs, put, or post.

var stream = db.createWriteStream();
stream.write({
  foo: 'bar',
  _id: 'testDoc'
}, function () {
  // chunk is flushed
});

but wait there is more, the database itself is a write streem though you can't close it, you can do

var random = require("random-document-stream");
random(100).pipe(db);

Readable

var db = new PouchDB('foo');
var stream = db.createReadStream();
stream.on('data', function (d) {
  // deal with data
});

you can also set since

var stream = db.createReadStream({since:19}); stream.on('data', function (d) { // deal with data after seq 19 });