Feel free to send in more questions as they come :-)

Okay, I have another one :)

How are views with a reduce function affected by deletes and updates? Given the example (<http://wiki.apache.org/couchdb/HttpViewApi>) of:

    "total_purchases": {
"map": "function(doc) { if (doc.Type == 'purchase') emit(doc.Customer, doc.Amount) }",
      "reduce": "function(keys, values) { return sum(values) }"
    }

How would that total be updated if something were deleted or updated? Does the sum() function have to be evaluated over doc.Amount of *every* doc on every update?

Reply via email to