I am using MongoDB with Node.JS. I have a collection which contains a date and other rows. The date is a JavaScript Date object.
Date
How can I sort this col
db.getCollection('').find({}).sort({_id:-1})
This will sort your collection in descending order based on the date of insertion