is there way add new field and its value into existed all couchdb documents, like following I want to add "emailType": "true" into the existed document for emails docType, not sure how can I use updatehandler to achieve this, thank
{
"_id": "37fbfee963e9a989becbe9fe746891eb",
"_rev": "5-28bb00c72c0807772051d8d71b67eda0",
"docType":"emails",
"emails": [
{
"emailAddress": "aaaa",
"emailType": "true"
}
}
here is what I get the existed email document
function(doc) {
if (doc.emails && doc.docType == "emails") {
var emailsLength = doc.emails.length;
for (var i = 0; i < emailsLength ; i++) {
emit(doc.emails[i].emailAddress, doc);
}
}
}