Answer the question
In order to leave comments, you need to log in
CouchDB: map/reduce selection by time span and additional keys
The database contains the following documents:
{
"user_id": 1,
"event_id": 2,
"event_dt": [
2013, 11, 15, 10, 0, 0, 0
]
}
limit=XXX
), because the time interval can be up to a year.function map(doc) {
emit([doc.user_id, doc.event_dt], doc.event_id);
}
group_level=2
):function map(doc) {
emit([doc.user_id, doc.event_id, doc.event_dt], 1);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question