Skip to content

HasSkip

Pipeline implementing the $skip stage.

Inheritors

Properties

context

@LowLevelApi



abstract val context: BsonContext

The context used to generate this pipeline.

Functions

reinterpret

@DangerousMongoApi



@LowLevelApi



abstract fun <New : Any> reinterpret(): Pipeline<New>

Changes the type of the returned document, with no type-safety.

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

toString

abstract override fun toString(): String

JSON representation of this pipeline.

withStage

@DangerousMongoApi



@LowLevelApi



abstract fun withStage(stage: BsonNode): Pipeline<Document>

Creates a new pipeline that expands on the current one by adding stage.

writeTo

@LowLevelApi



abstract fun writeTo(writer: BsonValueWriter)

Writes the entire pipeline into writer.