mongo date take no time code example
Example: mongodb check date only without time
db.collection.aggregate([{
$addFields: {
onlyDate: {
$dateToString: {
format: '%Y-%m-%d',
date: '$date'
}
}
}
},
{
$match: {
onlyDate: {
'$eq': onlyTodayDate
}
}
}
]);