Answers for "mongodb check date only without time"

0

mongodb check date only without time

db.collection.aggregate([{
                $addFields: {
                    onlyDate: {
                        $dateToString: {
                            format: '%Y-%m-%d',
                            date: '$date'
                        }
                    }
                }
            }, 
            {
                $match: {
                    onlyDate: {
                        '$eq': onlyTodayDate
                    }
                }
            }
        ]);
Posted by: Guest on November-25-2020

Code answers related to "mongodb check date only without time"

Browse Popular Code Answers by Language