Skip to content

Instantly share code, notes, and snippets.

View snsparrish's full-sized avatar

Shawn Parrish snsparrish

View GitHub Profile
@snsparrish
snsparrish / gist:1603065
Created January 12, 2012 20:58 — forked from thinkjson/gist:1603039
Remove field from all docs in a CouchDB database
console.log("Fetching docs...");
var j = 0;
var docs = [];
var ids = [];
var startdoc = '0';
function fetchdocs(startdocthistime){
nano.list({ stale: "ok", startkey:startdocthistime, limit:1000, include_docs:true}, function(err, data, headers){
console.log("Updating " + data.rows.length + " docs...");
for (var i = 0; i < data.rows.length; i++) {
ids.push(data.rows[i].id);