extrack date without hour mongo 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
}
}
}
]);