Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Backbone Cloudant

Helper objects for interacting with data stored in Cloudant from Backbone.

This is an experimental project to demo the ease of using Cloudant with Backbone. 
There's an open question around how auth gets done neatly, partly because that is very
application dependent, but the rest of the code is in a usable state.

Getting Started

Download the production version or the development version. The code depends on Backbone and Underscore only.

In your web page:

<script src="jquery.js"></script>
<script src="underscore.js"></script>
<script src="backbone.js"></script>
<script src="dist/backbone.cloudant.min.js"></script>
  Backbone.Cloudant.database = "/backbone-cloudant-demo/";
  // start the change handler

  var all_docs = new Backbone.Cloudant.Docs.Collection();
  var all_docs_view = new MyView({collection: all_docs, id: '#all_docs'});

  all_docs.fetch().fail(function(){console.log('Could not load all_docs collection');});



Documentation is generated with docco. You can generate the docs using grunt docs if you have installed the dev dependencies.


  • npm install
  • Edit url.json to point to your database

Known issues

  • Need a decent way of handling auth details
  • Improve collection initialize
  • grunt-couchapp can't delete authenticated URL's

Using Backbone.Cloudant with Apache CouchDB

There is nothing that prevents using Backbone.Cloudant with CouchDB where the two systems have feature parity. The Search collection isn't usable with CouchDB, as that functionality is only available via Cloudant. All other collections and change handling should work with CouchDB and are tested on CouchDB as well as Cloudant.


Release History

  • 3rd August 2013: v0.0.2 - updated for grunt 0.4.x and clarified naming of Index collections
  • 17th September 2012: v0.0.1 - released for public testing


Copyright (c) 2012, 2013 Cloudant

Licensed under the MIT license.


In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Important notes

Please don't edit files in the dist subdirectory as they are generated via grunt. You'll find source code in the src subdirectory!

While grunt can run the included unit tests via PhantomJS, this shouldn't be considered a substitute for the real thing. Please be sure to test the test/*.html unit test file(s) in actual browsers.

Installing grunt

This assumes you have node.js and npm installed already.

  1. Test that grunt is installed globally by running grunt --version at the command-line.
  2. If grunt isn't installed globally, run npm install -g grunt to install the latest version. You may need to run sudo npm install -g grunt.
  3. From the root directory of this project, run npm install to install the project's dependencies.

Installing PhantomJS

In order for the qunit task to work properly, PhantomJS must be installed and in the system PATH (if you can run "phantomjs" at the command line, this task should work).

Unfortunately, PhantomJS cannot be installed automatically via npm or grunt, so you need to install it yourself. There are a number of ways to install PhantomJS.

Note that the phantomjs executable needs to be in the system PATH for grunt to see it.


Experimental helper objects for interacting with data stored in Cloudant







No releases published


No packages published