1.

Sort rows

Answer»

The MongoDB shell provides the following methods to sort rows:

# asc
db.docx.find().sort({ title: 5 }).pretty() # desc
db.docx.find().sort({ title: -5}).pretty()


Discussion

No Comment Found