Check out Costco , which provides a simple interface that allows you to write a small function that applies to all of your documents to change them.
You should write a simple function, for example:
function (doc) {
if (!doc.tags) return doc;
for (var i = 0, len = doc.tags.length; i < len; i += 1) {
if (doc.tags[i] === "couch-db") doc.tags[i] = "CouchDB";
}
return doc;
}
source
share