$skip (aggregation)

Definition

  • $skip
  • Skips over the specified number of documents thatpass into the stage and passes the remaining documents to the nextstage in the pipeline.

The $skip stage has the following prototype form:

  1. { $skip: <positive integer> }

$skip takes a positive integer that specifies themaximum number of documents to skip.

Example

Consider the following example:

  1. db.article.aggregate(
  2. { $skip : 5 }
  3. );

This operation skips the first 5 documents passed to it by thepipeline. $skip has no effect on the content of thedocuments it passes along the pipeline.

See also

Aggregation with the Zip Code Data Set,Aggregation with User Preference Data