Skip to content

Instantly share code, notes, and snippets.

@janmonschke
Created May 31, 2011 11:09

Revisions

  1. janmonschke created this gist May 31, 2011.
    6 changes: 6 additions & 0 deletions map.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    // ddoc/byCollection/map.js
    function(doc) {
    if(doc.collection){
    emit(doc.collection, doc);
    }
    }
    5 changes: 5 additions & 0 deletions yourapp.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    // 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;