pull-couchdb
Pull-streams for reading and writing in CouchDB.
Install
npm i pull-couchdb
Usage
allDocs(db)
Requests CouchDB's GET /{db}/_all_docs
and streams the results.
pull(
allDocs('http://localhost:5984/foo_storage'),
drain(record => {
// ...
})
)
saveEach(db, params)
Saves each object to CouchDB using POST /{db}
.
pull(
values([
{ test: 'Hello world' }
{ test: 'foo' },
{ test: 'bar' }
]),
saveEach('http://localhost:5984/foo_storage'),
collect((err, results) => {
// ...
})
)