Google News
logo
MongoDB - Interview Questions
What is the syntax of the sort() method?
In MongoDB, the following syntax is used for sorting documents :
 
>db.COLLECTION_NAME.find().sort({KEY:1})

Advertisement