how can i change the date formats in mongodb to %d/%m/%y from %d-%m-%y 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
}
}
}
]);