Skip to content

Instantly share code, notes, and snippets.

@janmonschke
Created May 31, 2011 11:09
Show Gist options
  • Save janmonschke/1000316 to your computer and use it in GitHub Desktop.
Save janmonschke/1000316 to your computer and use it in GitHub Desktop.
Backbone couch connector blogpost v0.1
// ddoc/byCollection/map.js
function(doc) {
if(doc.collection){
emit(doc.collection, doc);
}
}
// paste this into your app file and fill in your couchdb setup
Backbone.couchConnector.databaseName = "backbone-couchapp";
Backbone.couchConnector.ddocName = "backbone-couchapp";
Backbone.couchConnector.viewName = "byCollection";
Backbone.couchConnector.enableChanges = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment