Get the latest record from mongodb collection

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})

Leave a Comment