yacw

0.2.3 • Public • Published

Yet Another CouchDB Wrapper

Build Status Extract from connect-couchdb middleware

API

Constructor :

Couch = function (config) {}

Default config (name is required) :

{name: '<your_database_name>',
 host: "127.0.0.1",
 port: 5984,
 username: '',
 password: '',
 ssl: false}

Alternative config with uri of your CouchDb database :

{uri: 'http://127.0.0.1:5984/<your_database_name>'}

When uri is defined all other properties are ignored and can be left out, including name.

Database options :

Couch.prototype.putOpt = function(field, value, callback) {}
Couch.prototype.getOpt = function(field, callback) {}

Records management :

Couch.prototype.put = function(doc, callback) {}
Couch.prototype.post = function(doc, callback) {}
Couch.prototype.del = function(doc, callback) {}
Couch.prototype.get = function(id, callback) {}
Couch.prototype.head = function(id, callback) {}
Couch.prototype.bulk = function({docs: [...]}, callback) {}

Views management :

Couch.prototype.view = function(view, options, callback) {}
Couch.prototype.putDesignDocs = function(files, callback) {}

Database management :

Couch.prototype.dbPut = function(callback) {}
Couch.prototype.dbDel = function(callback) {}

Package Sidebar

Install

npm i yacw

Weekly Downloads

12

Version

0.2.3

License

none

Last publish

Collaborators

  • tdebarochez