Skip to content
/ couch Public

A small wrapper around nano for getting up and running with CouchDB.

License

Notifications You must be signed in to change notification settings

holmwell/couch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

couch

A small wrapper around nano for getting up and running with CouchDB and some design docs.

Usage

    var db;
    var designDocs = [{
        url: '_design/members',
        body: 
        {
            version: "1.0.2",
            language: "javascript",
            views: {
                byMemberId: {
                    map: function (doc) {
                        if (doc.type === "member") {
                            emit(doc.memberId, doc);
                        }
                    }
                }
            }
        }
    ];

    var couch = require("@holmwell/couch")('my-local-database', designDocs);
    couch.whenReady(function () {
       db = couch.db; 
    });

    // Assert: db === require('nano')('http://localhost:5984').use('my-local-database')
    // ... and your design docs are in the database.

About

A small wrapper around nano for getting up and running with CouchDB.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published