MongoDB sort method sorts the document in either ascending or descending order as specified by the user in the input argument. The syntax for sort method is sort order can take the following values 1: specifies that the field should be sorted in ascending order -1: specifies that the field …
↧