i have wriiten a query to display the date to me.
'dateFrom': {'$dateToString': {'format': '%Y-%m-%d','date': '$$list.dateFrom'}},
date in the database is stored as 07-09-2018
query displayed result as 06-09-2018
this because mongodb stores date off by 1 hour (day light saving) in db as 06-09-2018T23:00:00 and my query get me the dd,mm,yy from the datetime.
though this can be one of the solution (courtesy Asya Kamsky)
*****************************
{$project:{date:{$dateToString:{format:"%Y-%m-%d",date:{$add:["$created_at",X*60*60*1000]}}}}}
where X is the number of hours you are ahead of UTC (date addition in aggregation takes milliseconds).
*************************************************
is there any other way i can get he correct date i.e 07-09-2018
Thanks
Sachin