0.0.11 • Published 12 years ago
loveseat v0.0.11
loveseat
Sometimes you don't need the whole couch.
usage
var Loveseat = require('loveseat').Loveseat,
db = new Loveseat({ db: 'mydb' });
db.insert({ name: 'My Document' }, function (err, res) {
console.log(res);
});other options
when making a new Loveseat, available options are:
db: the name of the db, defaults to "test"url: the url to the couchdb, defaults to "http://localhost:5984/" and should be in that format if customized.
API
db.insert([ id,] document [, callback])Insert (or update) a document with optionaliddb.destroy(id, rev [, callback])Delete document withid, revisionrevdb.get(id [, callback])Get document byiddb.create([callback])Creates the database if it does not already existdb.check([callback])Checks for the presence of your selected dbdb.makeRequest(method[, url, data, callback)Build a manual request to the couch.
All callbacks are of form (err, res) where res is the JSON-parsed response from couch.
license
MIT
