Stage

public class Stage<T extends Stage<@NonNull 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 extends Stage<@NonNull T>> Stage(
    @NonNull String name,
    @NonNull InternalOptions options
)

Public methods

final @NonNull T
withOption(@NonNull String key, boolean value)

Specify named Boolean parameter

final @NonNull T
withOption(@NonNull String key, double value)

Specify named Double parameter

final @NonNull T

Specify named Field parameter

final @NonNull T
withOption(@NonNull String key, long value)

Specify named Long parameter

final @NonNull T

Specify named String parameter

Protected methods

final @NonNull T

Protected constructors

Stage

protected <T extends Stage<@NonNull T>> Stage(
    @NonNull String name,
    @NonNull InternalOptions options
)

Public methods

withOption

public final @NonNullwithOption(@NonNull String key, boolean value)

Specify named Boolean parameter

Parameters
@NonNull String key

The name of parameter

boolean value

The Boolean value of parameter

Returns
@NonNull T

New stage with named parameter.

withOption

public final @NonNullwithOption(@NonNull String key, double value)

Specify named Double parameter

Parameters
@NonNull String key

The name of parameter

double value

The Double value of parameter

Returns
@NonNull T

New stage with named parameter.

withOption

public final @NonNullwithOption(@NonNull String key, @NonNull Field value)

Specify named Field parameter

Parameters
@NonNull String key

The name of parameter

@NonNull Field value

The Field value of parameter

Returns
@NonNull T

New stage with named parameter.

withOption

public final @NonNullwithOption(@NonNull String key, long value)

Specify named Long parameter

Parameters
@NonNull String key

The name of parameter

long value

The Long value of parameter

Returns
@NonNull T

New stage with named parameter.

withOption

public final @NonNullwithOption(@NonNull String key, @NonNull String value)

Specify named String parameter

Parameters
@NonNull String key

The name of parameter

@NonNull String value

The String value of parameter

Returns
@NonNull T

New stage with named parameter.

Protected methods

withOption

protected final @NonNullwithOption(
    @NonNull String key,
    @NonNull <Error class: unknown class> value
)