janmonschke/backbone-couchdb — Issue #24: Support for deletion changes?
Author: ahamid
Created: 2011-11-06 06:58:06+00:00
State: open

Does backbone-couchdb support deletion changes? By default it uses the by_collection filter. If I just return true from such a filter, then the deletion entries come across in the change feed, of course this breaks backbone-couchdb since it is expecting only pre-filtered models. If the filter actually filters by collection, then i get the right models, but never any deletions in the change feed (makes sense if the deletion occurs before the filter can inspect).

function(doc, req) {
//if (doc.collection) {
// emit(doc.collection, doc);
//}
//return (doc.collection == req.query.collection || doc._deleted == "true");
return true;
}