On this page本页内容
$skip
¶Skips over the specified number of documents that pass into the stage and passes the remaining documents to the next stage in the pipeline.跳过传递到该阶段的指定数量的文档,并将剩余的文档传递到管道中的下一个阶段。
The $skip
stage has the following prototype form:$skip
阶段的原型形式如下:
$skip
takes a positive integer that specifies the maximum number of documents to skip.接受一个正整数,该整数指定要跳过的最大文档数。
If using the 如果将$skip
stage with any of:$skip
阶段用于以下任何一种情况:
$sort
aggregation stage,$sort
聚合阶段,sort()
method, orsort()
方法,或sort
field to the findAndModify
command or the findAndModify()
shell method.findAndModify
命令或findAndModify()
shell方法的sort
字段。be sure that you are performing a stable sort before passing results to the 在将结果传递到$skip
stage. $skip
阶段之前,请确保正在执行稳定的排序。A stable sort ensures that the sort order of returned documents remains the same across multiple executions of the same sort; especially important when used with the 稳定的排序可确保在多次执行相同排序时,返回文档的排序顺序保持不变;与$skip
stage.$skip
阶段一起使用时尤其重要。
See the following for more information on each:有关每种方法的更多信息,请参阅以下内容: