Stage

@Beta
sealed class Stage<T : Stage<T>>

Known direct subclasses
AggregateStage

Performs optionally grouped aggregation operations on the documents from previous stages.

CollectionGroupSource
CollectionSource
FindNearestStage

Performs a vector similarity search, ordering the result set by most similar to least similar, and returning the first N documents in the result set.

RawStage

Adds a stage to the pipeline by specifying the stage name as an argument.

SampleStage

Performs a pseudo-random sampling of the input documents.

UnnestStage

Takes a specified array from the input documents and outputs a document for each element with the element stored in a field with name specified by the alias.


Summary

Protected constructors

<T : Stage<T>> Stage(name: String, options: InternalOptions)

Public functions

T
withOption(key: String, value: Boolean)

Specify named Boolean parameter

T
withOption(key: String, value: Double)

Specify named Double parameter

T
withOption(key: String, value: Field)

Specify named Field parameter

T
withOption(key: String, value: Long)

Specify named Long parameter

T
withOption(key: String, value: String)

Specify named String parameter

Protected functions

T

Protected constructors

Stage

protected <T : Stage<T>> Stage(name: String, options: InternalOptions)

Public functions

withOption

fun withOption(key: String, value: Boolean): T

Specify named Boolean parameter

Parameters
key: String

The name of parameter

value: Boolean

The Boolean value of parameter

Returns
T

New stage with named parameter.

withOption

fun withOption(key: String, value: Double): T

Specify named Double parameter

Parameters
key: String

The name of parameter

value: Double

The Double value of parameter

Returns
T

New stage with named parameter.

withOption

fun withOption(key: String, value: Field): T

Specify named Field parameter

Parameters
key: String

The name of parameter

value: Field

The Field value of parameter

Returns
T

New stage with named parameter.

withOption

fun withOption(key: String, value: Long): T

Specify named Long parameter

Parameters
key: String

The name of parameter

value: Long

The Long value of parameter

Returns
T

New stage with named parameter.

withOption

fun withOption(key: String, value: String): T

Specify named String parameter

Parameters
key: String

The name of parameter

value: String

The String value of parameter

Returns
T

New stage with named parameter.

Protected functions

withOption

protected fun withOption(key: String, value: <Error class: unknown class>): T