How to use sort() in MongoDB update statements?
I just want to update the top 2 highest fields in the database. db.Employee.update({ db.Employee.find().sort({ Age: -1 }).limit(2) --This part here wont work-- }, { $set: { Benefits: ["Vacation", "Rolex"] } } ) Apparently MongoDB does not support such ability.…