Is it possible to add a built in reduce function to a view via the client? When I try to do this, I get the following:
{“error”:“invalid_design_document”,“reason”:“Syntax error in the reduce function of the view `exceptions’: ReferenceError: _count is not defined”}
Here’s my map/reduce on that particular view:
{
"map": "function (doc, meta) {if(doc.type === "LogItem"){ emit([doc.originatingSystem, doc.level, doc.timeStamp], null); }}",
"reduce": "_count"
}
I need to be able to avoid going into the admin console to add a built-in reduce to a view.
Any help would be appreciated. Thanks!