npm

npm’s 2019 JavaScript ecosystem survey analysis is now available! Get your copy here »

couchdb-transactions

2.0.1 • Public • Published

Build Status Coverage Status

Couchdb transactions

Inspired by txn this library loads, modifies and commits documents to couchdb. It also will retry failed requests. The libray has zero dependencies but requires an instance of nano.

Usage

const couchdbTxn = require('couchdb-transactions');
const db = require('nano')('http:....');

function sumTransaction(doc) {
    doc.sum = 1 + (doc.sum || 0);
}

let txn = couchdbTxn(db, sumTransaction);

let doc = {_id:'xyz'};

txn(doc, function (err, response){
    console.log('response', response);
);

install

npm i couchdb-transactions

Downloadsweekly downloads

4

version

2.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability