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(
My Solution :
db.collection("name of collection").find({}, {limit: 1}).sort({$natural: -1})