Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 1.22 KB

README.md

File metadata and controls

45 lines (33 loc) · 1.22 KB

Chesterfield

npm version Build Status Coverage Status

Chesterfield is wrapper for the Node JS Couchbase SDK for writing Functional Javascript.

Installation

npm install chesterfield --save

Running Tests

git clone https://github.com/binaryalchemist/chesterfield.git
cd chesterfield
npm test

Example

var cb = require('chesterfield');

var cluster = cb.cluster('couchbase://address2couchbase');
var bucket = cb.open(cluster, 'bucket_name', 'password');

var popeMobile = {
    id: 9000,
    type: 'miracle whip'
};

var popeMobileKey = 'vehicle_' + popeMobile.id;

cb.upsert(bucket, popeMobileKey, popeMobile, function(error, result) {
    cb.get(bucket, popeMobileKey, function(error, result) {
        console.log(JSON.stringify(result.value));
    });
});

Contributing

Please see CONTRIBUTING.md for more details on contributing to the repository.