How to sort a collection by date in MongoDB?
db.getCollection('').find({}).sort({_id:-1})
This will sort your collection in descending order based on the date of insertion
Just a slight modification to @JohnnyHK answer
collection.find().sort({datefield: -1}, function(err, cursor){...});
In many use cases we wish to have latest records to be returned (like for latest updates / inserts).