Articles → MONGODB → Sort The Cursor Result In Mongodb

Sort The Cursor Result In Mongodb






Example




Picture showing the sample mongodb document




var sortCursor1 = db.Articles.find()
sortCursor1.sort({ subject: 1 })





Output


Picture showing the output of sorting a cursor in mongodb





Posted By  -  Karan Gupta
 
Posted On  -  Friday, March 15, 2024

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250