0.0.11 • Published 10 years ago

loveseat v0.0.11

Weekly downloads
4
License
MIT
Repository
github
Last release
10 years ago

loveseat

Build Status

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 optional id
  • db.destroy(id, rev [, callback]) Delete document with id, revision rev
  • db.get(id [, callback]) Get document by id
  • db.create([callback]) Creates the database if it does not already exist
  • db.check([callback]) Checks for the presence of your selected db
  • db.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

0.0.11

10 years ago

0.0.10

10 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago