In normal queries, sort
is processed first, then skip
, and then limit
, no matter in which order you add them to your cursor object.
The aggregation framework will execute the $sort
, $skip
and limit
operators in their order of appearance in the pipeline.