Pipeline class

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

export declare class Pipeline 

Methods

Method Modifiers Description
addFields(field, additionalFields) (Public Preview)
addFields(options) (Public Preview)
aggregate(accumulator, additionalAccumulators) (Public Preview)
aggregate(options) (Public Preview)
distinct(group, additionalGroups) (Public Preview)
distinct(options) (Public Preview)
findNearest(options) (Public Preview)
limit(limit) (Public Preview)
limit(options) (Public Preview)
offset(offset) (Public Preview)
offset(options) (Public Preview)
rawStage(name, params, options) (Public Preview)
removeFields(fieldValue, additionalFields) (Public Preview)
removeFields(options) (Public Preview)
replaceWith(fieldName) (Public Preview)
replaceWith(expr) (Public Preview)
replaceWith(options) (Public Preview)
sample(documents) (Public Preview)
sample(options) (Public Preview)
select(selection, additionalSelections) (Public Preview)
select(options) (Public Preview)
sort(ordering, additionalOrderings) (Public Preview)
sort(options) (Public Preview)
union(other) (Public Preview)
union(options) (Public Preview)
unnest(selectable, indexField) (Public Preview)
unnest(options) (Public Preview)
where(condition) (Public Preview)
where(options) (Public Preview)

Pipeline.addFields()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

addFields(field: Selectable, ...additionalFields: Selectable[]): Pipeline;

Parameters

Parameter Type Description
field Selectable
additionalFields Selectable[]

Returns:

Pipeline

Pipeline.addFields()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

addFields(options: AddFieldsStageOptions): Pipeline;

Parameters

Parameter Type Description
options AddFieldsStageOptions

Returns:

Pipeline

Pipeline.aggregate()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

aggregate(accumulator: AliasedAggregate, ...additionalAccumulators: AliasedAggregate[]): Pipeline;

Parameters

Parameter Type Description
accumulator AliasedAggregate
additionalAccumulators AliasedAggregate[]

Returns:

Pipeline

Pipeline.aggregate()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

aggregate(options: AggregateStageOptions): Pipeline;

Parameters

Parameter Type Description
options AggregateStageOptions

Returns:

Pipeline

Pipeline.distinct()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

distinct(group: string | Selectable, ...additionalGroups: Array<string | Selectable>): Pipeline;

Parameters

Parameter Type Description
group string | Selectable
additionalGroups Array<string | Selectable>

Returns:

Pipeline

Pipeline.distinct()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

distinct(options: DistinctStageOptions): Pipeline;

Parameters

Parameter Type Description
options DistinctStageOptions

Returns:

Pipeline

Pipeline.findNearest()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

findNearest(options: FindNearestStageOptions): Pipeline;

Parameters

Parameter Type Description
options FindNearestStageOptions

Returns:

Pipeline

Pipeline.limit()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

limit(limit: number): Pipeline;

Parameters

Parameter Type Description
limit number

Returns:

Pipeline

Pipeline.limit()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

limit(options: LimitStageOptions): Pipeline;

Parameters

Parameter Type Description
options LimitStageOptions

Returns:

Pipeline

Pipeline.offset()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

offset(offset: number): Pipeline;

Parameters

Parameter Type Description
offset number

Returns:

Pipeline

Pipeline.offset()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

offset(options: OffsetStageOptions): Pipeline;

Parameters

Parameter Type Description
options OffsetStageOptions

Returns:

Pipeline

Pipeline.rawStage()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

rawStage(name: string, params: unknown[], options?: { [key: string]: Expression | unknown; }): Pipeline;

Parameters

Parameter Type Description
name string
params unknown[]
options { [key: string]: Expression | unknown; }

Returns:

Pipeline

Pipeline.removeFields()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

removeFields(fieldValue: Field | string, ...additionalFields: Array<Field | string>): Pipeline;

Parameters

Parameter Type Description
fieldValue Field | string
additionalFields Array<Field | string>

Returns:

Pipeline

Pipeline.removeFields()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

removeFields(options: RemoveFieldsStageOptions): Pipeline;

Parameters

Parameter Type Description
options RemoveFieldsStageOptions

Returns:

Pipeline

Pipeline.replaceWith()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

replaceWith(fieldName: string): Pipeline;

Parameters

Parameter Type Description
fieldName string

Returns:

Pipeline

Pipeline.replaceWith()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

replaceWith(expr: Expression): Pipeline;

Parameters

Parameter Type Description
expr Expression

Returns:

Pipeline

Pipeline.replaceWith()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

replaceWith(options: ReplaceWithStageOptions): Pipeline;

Parameters

Parameter Type Description
options ReplaceWithStageOptions

Returns:

Pipeline

Pipeline.sample()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

sample(documents: number): Pipeline;

Parameters

Parameter Type Description
documents number

Returns:

Pipeline

Pipeline.sample()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

sample(options: SampleStageOptions): Pipeline;

Parameters

Parameter Type Description
options SampleStageOptions

Returns:

Pipeline

Pipeline.select()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

select(selection: Selectable | string, ...additionalSelections: Array<Selectable | string>): Pipeline;

Parameters

Parameter Type Description
selection Selectable | string
additionalSelections Array<Selectable | string>

Returns:

Pipeline

Pipeline.select()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

select(options: SelectStageOptions): Pipeline;

Parameters

Parameter Type Description
options SelectStageOptions

Returns:

Pipeline

Pipeline.sort()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

sort(ordering: Ordering, ...additionalOrderings: Ordering[]): Pipeline;

Parameters

Parameter Type Description
ordering Ordering
additionalOrderings Ordering[]

Returns:

Pipeline

Pipeline.sort()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

sort(options: SortStageOptions): Pipeline;

Parameters

Parameter Type Description
options SortStageOptions

Returns:

Pipeline

Pipeline.union()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

union(other: Pipeline): Pipeline;

Parameters

Parameter Type Description
other Pipeline

Returns:

Pipeline

Pipeline.union()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

union(options: UnionStageOptions): Pipeline;

Parameters

Parameter Type Description
options UnionStageOptions

Returns:

Pipeline

Pipeline.unnest()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

unnest(selectable: Selectable, indexField?: string): Pipeline;

Parameters

Parameter Type Description
selectable Selectable
indexField string

Returns:

Pipeline

Pipeline.unnest()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

unnest(options: UnnestStageOptions): Pipeline;

Parameters

Parameter Type Description
options UnnestStageOptions

Returns:

Pipeline

Pipeline.where()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

where(condition: BooleanExpression): Pipeline;

Parameters

Parameter Type Description
condition BooleanExpression

Returns:

Pipeline

Pipeline.where()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

where(options: WhereStageOptions): Pipeline;

Parameters

Parameter Type Description
options WhereStageOptions

Returns:

Pipeline