Pipeline class Stay organized with collections Save and categorize content based on your preferences.
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:
exportdeclareclassPipelineMethods
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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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:
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-01-15 UTC.