I have a document with this format in CouchDB:
{
"box": 1,
"store": "New City",
"types": "sales"
}
I have the following map function:
function(doc) {
if (doc.types == "sales") {
if ( doc.box != null && doc.box != false)
{
emit(doc.box, doc.store);
}
}
}
I want to display the number of box for each store but I can't create a reduce function.