couch-getsetgo

1.0.6 • Public • Published

getsetgo

Easy to use nodejs couchdb driver. Couchdb becomes a simple keystore with a get() and set() functions.

Install:

npm install couch-getsetgo

Test:

cd node_modules/couch-getsetgo/
node test.js

Examples:

db = require('couch-getsetgo');
db.connect({url: 'http://getsetgo-test.iriscouch.com/test'});

Write:

Inserts new doc or update existing.

doc = {_id: '12345', x: 1, y: 2};

db.set( doc );

Read:

db.get('12345', function (err, doc) {
  if (doc) {
    // Success
  }
});

Full Example:

db.connect({url: 'http://getsetgo-test.iriscouch.com/test'});

doc1 = {_id: '12345', x: 1, y: 2};

db.set(doc1, function (err) {
  if (!err) {
    // Successfully saved
    db.get('12345', function (err, doc2) {
      if (doc2) {
        // Success
        console.log(doc2);
      }
    });
  }
});

Relax !

Readme

Keywords

none

Package Sidebar

Install

npm i couch-getsetgo

Weekly Downloads

6

Version

1.0.6

License

none

Last publish

Collaborators

  • siddiq