0

Please help me! After grouping by day , i have got this :

{ "_id" : { "year" : 2017, "month" : 11, "day" : 8 }, "count" : 142.0 }

and this is what i want , but i need to convert this day in timestamp like 1510221787000 , is that possible with a simple project ? i tried this but doesn't work:

{
  $project:{
      "newdate": new Date("$_id.year","$_id.month","$_id.day"),
      "count":1
  }

}

thank you in advance.

wassim ben
  • 11
  • 4
  • The solution of course it "don't split up the date into "year", "month" and "day" when grouping. There are other ways you can "round" the date instead. – Neil Lunn Nov 13 '17 at 20:31
  • thank you chridam & Neil , i'll try to round the date as Neil suggestion . – wassim ben Nov 14 '17 at 09:45

0 Answers0