Skip to content

HasMatch

Pipeline implementing the $match stage.

Inheritors

Properties

context

The context used to generate this pipeline.

Functions

match

open fun match(filter: FilterQuery<Document>.() -> Unit): Pipeline<Document>

Filters documents based on a specified filter.

Matched documents are passed to the next pipeline stage.

Pipeline optimization

Place the match call as early in the pipeline as possible. Because match limits the total number of elements being processed, earlier match operations minimize the amount of processing down the pipe.

If you place a match at the very beginning of a pipeline, the query can take advantage of indexes.

External resources

reinterpret

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

toString

abstract override fun toString(): String

JSON representation of this pipeline.

withStage

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.