couchdbreq
v0.0.1
Published
Very simple client to couchdb
Downloads
1
Readme
couchdbreq
Very simple client to couchdb.
Install
Usage
Insert
var cdb = require('couchdbreq')();
//This is same as
//var cdb = require('couchdbreq')({host: "localhost", port: 5984});
cdb.insert("item", {foo:"bar"}, function(err, statusCode, response){
console.log(response);
});
Getting data
cdb.get("item", function(error, statusCode, response) {
if (statusCode === 404){
return;
}
console.log(response);
});
Get all documents
cdb.get("item/_all_docs", function(error, statusCode, response) {
if (statusCode === 404){
return;
}
console.log(response);
});
Delete
cdb.del("item", function(error, statusCode, response) {
if (error){
console.log(error);
return;
}
});
License
MIT