I want to format the date time into an specific format on the mongo shell output
My query
db.getCollection(\'people\').find({ date: {
Solution is using aggregation pipeline as stated by Veeram in comments section
db.getCollection('people').aggregate([ { $project:{ datetime: {$dateToString: {format: "%G-%m-%d %H:%M:%S",date: "$datetime"}}, age : 1 } } ]);