June 2015
Intermediate to advanced
192 pages
4h 8m
English
Although CouchDB provides a RESTful interface, you don't strictly need to make a database connection before using CouchDB; the Cradle module uses the notion of a connection to manage its internal state and there's still a connection object you need to create.
Here's how to include the Cradle module in your Node.js application and initialize it, getting a handle to a particular database:
var cradle = require('cradle');
var db = new(cradle.Connection)().database('documents');This code first includes the Cradle module, and then creates a new Cradle Connection object, setting its database to the database documents. This initializes Cradle with the default CouchDB host ...
Read now
Unlock full access