Last Updated: February 25, 2016
· zanona

Snippet: Flush CouchDB Database inside Futon

When inside Futon database page (, use the following script to delete (flush) all documents except the _design/*** docs.

This was pretty useful for testing in my case:

var couch = new $.futon.CouchDocumentPage();
couch.db.allDocs({success: function (all) {
    var docs = all
        .filter(function(item) { return !'_design'); })
        .map(function (item) { return {_id:, _rev: item.value.rev}});

    couch.db.bulkRemove({docs: docs}, {success: function (docs) {

1 Response
Add your response


It is probably an easy job, to transform this into a bookmarklet or a chrome extension to auto-add this as a button into futon's interface. just so it is not necessary the use of snippet anymore.

over 1 year ago ·