1.0.3 • Published 8 years ago

couchdb-creator v1.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

couchdb-creator

Utility for dynamically check for, and creating if their existence is doubtful, a specified DB in CouchDB via nano. Intended for stuff like Docker containers where one is unable to create the DB manually via Futon or the like.

Usage

  var nano = require("nano")("http://couchdb:5984");
  var creator = require("couchdb-creator");

  var foo;
  creator(nano, 'foo', function(db){
    foo = db;
  });

With design_doc:

  var nano = require("nano")("http://couchdb:5984");
  var creator = require("couchdb-creator");

  var doc = { "views":
      { "by_name_and_city":
        { "map": function(doc) { emit([doc.name, doc.city], doc._id); } }
      }
    };
  var foo;
  creator(nano, 'foo', {name : 'by_name_and_city', doc : doc}, function(db){
    foo = db;
  });
1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago