I have timestamped documents which contain an array of instances:
Example document:
{
"type": "occurance",
"present": [
{"id": ["x", "y"]},
{"id": ["x", "b"]},
{"id": ["y", "b"]}
],
"t": "2017-03-24T12:01:10.560Z"
}
Map is a classic one:
doc.present.forEach(function(u_id) {emit(u_id.id, doc.t);})
which returns, normally, all keys, values
.
However, when I reduce I get a null
key and a really large value.
I group keys, values
or combine values
(since rereduce
is a thing).
Data seem/are correct
Is there an option however, that I could get the results in the same fashion as the map query, only reduced?
This is my first map/reduce, so apologies for breaking all conventions on handling them properly