I want to know the most recent record in a collection. How to do that?
Note: I know the following command line queries works:
1. db.test.find().sort(
This is a rehash of the previous answer but it's more likely to work on different mongodb versions.
db.collection.find().limit(1).sort({$natural:-1})