Skip to content

Instantly share code, notes, and snippets.

@manobi
Created March 8, 2014 04:10
Show Gist options
  • Save manobi/9425208 to your computer and use it in GitHub Desktop.
Save manobi/9425208 to your computer and use it in GitHub Desktop.
Bulk delete with cradle
var docs = [
{ _id: 'a82e5e9a093b197960f69dfa17005132',
_rev: '1-70aa8fe77bbe596bded4a9de3aa185e4'
},
{ _id: 'a82e5e9a093b197960f69dfa1700534e',
_rev: '1-70aa8fe77bbe596bded4a9de3aa185e4'
}
]
docs = docs.map(function(doc){
doc._deleted = true;
return doc;
});
db.save(docs, callback);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment