To get only date part of date time use either substr i.e
"created_date" : { "$toDate" : { "$substr" : ['$created_at', 0, 10] } }
Or use $dateToString
Learn Linux, Nginx, Apache, MongoDB, MySQL, PHP, Javascript, CSS
To get only date part of date time use either substr i.e
"created_date" : { "$toDate" : { "$substr" : ['$created_at', 0, 10] } }
Or use $dateToString
Recent Comments