How do I sort records in mongodb?
beginer
1576
Points
53
Posts
|
Answers
Brian
2416
Points
14
Posts
|
Try following:
Posted On:
24-Sep-2021 06:55
|
Rahul M...
4960
Points
31
Posts
|
The basic syntax of sort() method is as follows:
So, you can use following:
Posted On:
25-Sep-2021 22:46
|
Priya
1278
Points
37
Posts
|
Use following for Ascending order:
For descending order:
Posted On:
25-Sep-2021 22:48
Thanks. - beginer 27-Sep-2021 21:11
|
Blog
Active User (0)
No Active User!