find limit max mongodb code example
Example 1: mongodb get max value
db.collection.find().sort({age:-1}).limit(1) // for MAX
db.collection.find().sort({age:+1}).limit(1) // for MIN
Example 2: mongodb limit find
db.collection.find(<query>).limit(<number>).skip(<number>)