- db.persons.find().sort({lastName: -1}}
- db.persons.find().sort({lastName: 1}}
- db.persons.find().sort({lastName: ascending}}
- db.persons.find().sort({lastName: $asc}}
You’d like a set of documents to be returned in last name, ascending order. Which query will accomplish this?
June 25, 2021June 25, 2021
0 Comment