mongodb find sort by id query code example Example: mongodb sort query db.Employee.find().sort({Employeeid:-1}).forEach(printjson)