a simple CouchDB module, which uses promises
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
main.js
package.json
tests.js

README.md

A simple, very lowlevel CouchDB module for node.js, which uses promises

only basic get, add, update functionality for now

Usage:

var CouchDB = require( 'promised-couch' ).CouchDB
var db = CouchDB( { base: 'http://user:password@127.0.0.1:5984/some-db/' } )

// get one doc:
db.get( 'some-doc-id' ).then( function success( doc ) { }, function error( err ) {} )

// get result of a view:
db.get( '_design/whatever/_view/someview', { key: 'blabla' } ).then( ... )

// add a document:
db.put( { somekey: 'somevalue' } ).then( ... )

// add a document with some id:
db.put( { somekey: 'somevalue' }, 'some-id' ).then( ... )

// update a document:
db.put( { _id: 'some-id', _rev: 'some-rev', somekey: 'somevalue' } ).then( ... )