These examples return all documents in the collection named
collection sorted by the age field in descending order.
Specify a value to $orderby of negative one (e.g.
-1, as above) to sort in descending order or a positive value
(e.g. 1) to sort in ascending order.

The sort function requires that the entire sort be able to complete
within 32 megabytes. When the sort option consumes more than 32
megabytes, MongoDB will return an error.

To avoid this error, create an index to support the sort operation or
use $orderby in conjunction with $maxScan
and/or cursor.limit(). The cursor.limit() increases
the speed and reduces the amount of memory required to return this
query by way of an optimized algorithm. The specified limit must result
in a number of documents that fall within the 32 megabyte limit.