3.0.0 • Published 2 years ago

couchdb-transactions v3.0.0

Weekly downloads
2
License
MIT
Repository
gitlab
Last release
2 years ago

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.

pipeline status coverage report

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

Contributing

Please respect the .eslintrc configuration.
Also, you will need to create a .env file with the URL of your CouchDB server.
See .env.sample

3.0.0

2 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.0

8 years ago