Node.js MongoDB Sort

In MongoDB, the sort() method is used to sort the result in ascending or descending order.

Code :