I have a Entries looks like
[Title] => test - Title - 33
[readedBy] => Array (0 => 5999,
1 => 85343
)
[clickedBy] => Array (
)
[deletedBy] => Array (
)
And i want to Check in my GROUP reduce function
function (obj, prev) {
obj.readedBy.forEach(function (doc){
if(doc == 800){
prev.status1.push(obj);
}else{
prev.status2.push(obj);
}
});
}
If is there my ID in the Relevan Array to push it to the right Status Array.
Foreach is no solution, because that ID array grows > 100k .
Is there a good way? Or is that solution rubbish ?
So far using mongodb map / reduce from what I’ve gathered, most of the time when you use map reduce you are going to suffer from an O(n) process, which means you will end up doing .forEach() on your result sets. They get faster as you add nodes. as you shard your collections.