I have a couple of documents in my couchdb database which all are like:
{
"_id":"1234567890",
"name": [
"category1": 5,
"category2": 8
]
}
I want to have a map function which gives me "category1" as key and 5 as value. I just can't separate "category" and 5.
I tried the following:
function(doc){
if(doc.name){
doc.name.forEach(function(sth) {
emit(sth, null);
});
}
}
Maybe someone can help me find a solution?