In the above documentation When u pass 2 parameters having start date and end date.how to apply the codition If the 2 parameters dates are matched (eg: yesterday date – today date)
var start = ISODate("2018-04-19T18:32:50.000Z");
var end =ISODate("2018-04-20T20:32:50.000Z");
db.collection.aggregate([
{$match : { "CREATEDATE" : { $gte:start, $lt:end} } },
{"$sort":{"CREATEDATE":1}},
{"$group":{
"_id":"$DATA_FROM",
"MAXDATE":{"$last":"$$ROOT"}
}},
])