All data are not the same.
First look at skip and limit, when the two are used together, regardless of their position order, default first skip, then limit.
The following figure:
Look at the sort, "6" statement, my data is sorted. After that, the three data are the same, regardless of how the transformation is sorted. (all possibilities are not listed here.) The skip and limit position changes are followed by the sort combination, but the results are still the same)
It can be concluded that when Sort,skip,limit is used together, regardless of the position change, always first sort and then skip, the last limit.
But I want to skip first, and then limit the number of bars to the last sort.
Can be used aggregate, aggregate has the nature of the pipeline flow, $skip, $limit, $sort the execution sequence is consistent with the position.
The position determines the order of execution.
Optimization of the aggregation pipeline:
Http://docs.mongoing.com/manual-zh/core/aggregation-pipeline-optimization.html#agg-sort-skip-limit-sequence