mapreduce - Using different keys for map & reduce -


i have current couch db stores activities happen on different nodes. i'm getting count of how many activities have happened on each node using following:

map:

function(doc) {   emit(doc.node._id, 1); } 

reduce:

_sum 

this works great! now, i'd allow filterable timestamp. first thought change map this:

function(doc) {   emit([doc.node._id, doc.created], 1); } 

however that, of course, added created flag key, reduce doesn't work how wanted anymore.

is there way can map node._id , created, reduce node._id?

edit: forgot mention, looked using group_level, works 1 key, , need able pass multiple keys index.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -