Skip to content

Instantly share code, notes, and snippets.

@puttputt
Last active August 29, 2015 13:57
Show Gist options
  • Save puttputt/9633916 to your computer and use it in GitHub Desktop.
Save puttputt/9633916 to your computer and use it in GitHub Desktop.
var o = {};
o.map = map;
o.reduce = reduce;
if(time!=null)
{
o.query = {time: {$gte: time}};
}
collection.mapReduce(o, function(err,result) {
result.forEach(function(order) {
order._id = order._id.getTime();
});
res.json(result);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment