Answers for "how to get max value in variable in mongodb"

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
Posted by: Guest on February-10-2021

Code answers related to "how to get max value in variable in mongodb"

Browse Popular Code Answers by Language