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})
More Related Contents:
- Retrieve only the queried element in an object array in MongoDB collection
- Does MongoDB’s $in clause guarantee order
- How to query nested objects?
- Update field in exact element array in MongoDB
- how to convert string to numerical values in mongodb
- How to find MongoDB field name at arbitrary depth
- Return only matched sub-document elements within a nested array
- Converting string to date in mongodb
- Querying internal array size in MongoDB
- MongoDB wildcard in the key of a query
- MongoDB Full and Partial Text Search
- Mongodb Join on _id field from String to ObjectId
- Difference between count() and find().count() in MongoDB
- How to insert an element to MongoDB internal list?
- Mongo sort on a calculated condition
- MongoDB: Calculate dwell time between every status value change
- How to ignore nulls while unmarshalling a MongoDB document?
- Using stored JavaScript functions in the Aggregation pipeline, MapReduce or runCommand
- MongoDB – The argument to $size must be an Array, but was of type: EOO / missing
- Mongodb query specific month|year not date
- convert iso date to timestamp in mongo query
- Remove Duplicates from MongoDB
- Using $slice operator to get last element of array
- How to access overall document count during arithmetic aggregation expression
- Push to two separate arrays in one update call in mongodb
- How to toggle a boolean field in one document with atomic operation?
- Update embedded object inside array inside array in MongoDB
- How can I sort a Meteor collection by time of insertion?
- mongodb aggregate query isn’t returning proper sum on using $sum
- MongoDB aggregate within daily grouping [duplicate]