I am trying to follow a similar work flow as others using Backbone and CouchDB. If my connector looks like this:
Backbone.couch_connector.config.db_name = window.location.pathname.split("/")[1];
Backbone.couch_connector.config.ddoc_name = window.location.pathname.split("/")[3];
Backbone.couch_connector.config.global_changes = false;
And my URL has the document _id, whats the cleanest way to get a document?
id
Call fetch()
on the model
routes: {
'/foo/:id' : 'doFoo'
}
doFoo = function(id) {
doc = new Model({ '_id' : id }).fetch();
}