1.0.6 • Published 12 years ago

couch-getsetgo v1.0.6

Weekly downloads
20
License
-
Repository
github
Last release
12 years ago

couch-getsetgo

Easy to use couchdb driver. Couchdb becomes a simple keystore.

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 !

1.0.6

12 years ago

1.0.5

12 years ago

1.0.4

12 years ago

1.0.3

12 years ago

1.0.1

12 years ago

1.0.0

12 years ago