Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danse/c63515ece4b11739e404 to your computer and use it in GitHub Desktop.
Save danse/c63515ece4b11739e404 to your computer and use it in GitHub Desktop.
var cradle = require('cradle');
var connection = new cradle.Connection(
'https://user:password@host',
443
);
var db = connection.database('database')
db.all({include_docs: true}, function(err, allDocs) {
if (err) {
console.log(err);
} else {
allDocs.forEach(function(doc) {
if (doc._id) {
if (doc._id.indexOf('__design') == -1) {
db.remove(doc._id, doc._rev, console.log);
}
} else {
console.log('doc: '+JSON.stringify(doc).slice(0, 100));
}
})
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment