0

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"}

  }},


])
VARUN
  • 149
  • 1
  • 10
  • What is the question? You have two dates there so what actually do you expect to happen? – Neil Lunn Apr 24 '18 at 05:48
  • @ Neil Lunn Iam expecting startdate match with yesterday date and enddate match with today date it is true apply onecondition the condition is false apply anothe condition please suggest me – VARUN Apr 24 '18 at 05:55
  • You might need to ask someone with assistance posting to an english language site such as this. From what I can gather, you likely mean what is covered in the duplicate question. If you do not, then please seek some assistance in making a clearer translation of what you actually need. I've pointed you to the [mcve](https://stackoverflow.com/help/mcve) statement on many occasions before. If you don't understand that, then please get someone to translate that for you as well. – Neil Lunn Apr 24 '18 at 05:59

0 Answers0