A promise-based asynchronous library for Couchbase and node.js.
The Official Couchbase Node.js Client Library provides only callback functions to handle the result of the asynchronous operations. This
couchbase-promise library wraps those callback functions with Bluebird promises to provide a convenient, promise-based interface.
couchbase-promise as a dependency:
npm install --save couchbase-promise
Then, reference it in your code file:
var Repository = ;
Initialize the repository with the connection string and the name of the bucket you want to connect to:
Use the static methods of the
Repository class to manage documents stored in your Couchbase database directly by their document identifiers:
You can also use the
getViewAsync method to query a document by a view.
- As a static class, currently supports only one connection string and one bucket.
- The views are always updated before reading data from them (
stalenot configurable yet).
Tip: If you find anything that limits the usage of this library for you, feel free the post a new issue and describe it.