Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.aggregation.stagesHasSkipskip

skip

open fun skip(amount: Long): Pipeline<Document>

Skips over the specified amount of documents that pass into the stage, and passes the remaining documents to the next stage.

Using skip with sorted results

Sort results aren't stable with skip: if multiple documents are identical, their relative order is undefined and may change from one execution to the next.

To avoid surprises, include a unique field in your sort, for example _id.

External resources

See also

open fun skip(amount: Int): Pipeline<Document>

Skips over the specified amount of documents that pass into the stage, and passes the remaining documents to the next stage.

Using skip with sorted results

Sort results aren't stable with skip: if multiple documents are identical, their relative order is undefined and may change from one execution to the next.

To avoid surprises, include a unique field in your sort, for example _id.

External resources

See also