PipelineSource 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.

Provides the entry point for defining the data source of a Firestore Pipeline.

Use the methods of this class (e.g., PipelineSource.collection(), PipelineSource.collectionGroup(), PipelineSource.database(), or PipelineSource.documents()) to specify the initial data for your pipeline, such as a collection, a collection group, the entire database, or a set of specific documents.

Signature:

export declare class PipelineSource<PipelineType> 

Methods

Method Modifiers Description
collection(collection) (Public Preview) Returns all documents from the entire collection. The collection can be nested.
collection(options) (Public Preview) Returns all documents from the entire collection. The collection can be nested.
collectionGroup(collectionId) (Public Preview) Returns all documents from a collection ID regardless of the parent.
collectionGroup(options) (Public Preview) Returns all documents from a collection ID regardless of the parent.
createFrom(query) (Public Preview) Convert the given Query into an equivalent Pipeline.
database() (Public Preview) Returns all documents from the entire database.
database(options) (Public Preview) Returns all documents from the entire database.
documents(docs) (Public Preview) Set the pipeline's source to the documents specified by the given paths and DocumentReferences.
documents(options) (Public Preview) Set the pipeline's source to the documents specified by the given paths and DocumentReferences.

PipelineSource.collection()

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.

Returns all documents from the entire collection. The collection can be nested.

Signature:

collection(collection: string | Query): PipelineType;

Parameters

Parameter Type Description
collection string | Query Name or reference to the collection that will be used as the Pipeline source.

Returns:

PipelineType

PipelineSource.collection()

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.

Returns all documents from the entire collection. The collection can be nested.

Signature:

collection(options: CollectionStageOptions): PipelineType;

Parameters

Parameter Type Description
options CollectionStageOptions Options defining how this CollectionStage is evaluated.

Returns:

PipelineType

PipelineSource.collectionGroup()

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.

Returns all documents from a collection ID regardless of the parent.

Signature:

collectionGroup(collectionId: string): PipelineType;

Parameters

Parameter Type Description
collectionId string ID of the collection group to use as the Pipeline source.

Returns:

PipelineType

PipelineSource.collectionGroup()

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.

Returns all documents from a collection ID regardless of the parent.

Signature:

collectionGroup(options: CollectionGroupStageOptions): PipelineType;

Parameters

Parameter Type Description
options CollectionGroupStageOptions Options defining how this CollectionGroupStage is evaluated.

Returns:

PipelineType

PipelineSource.createFrom()

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.

Convert the given Query into an equivalent Pipeline.

Signature:

createFrom(query: Query): Pipeline;

Parameters

Parameter Type Description
query Query A Query to be converted into a Pipeline.

Returns:

Pipeline

Exceptions

FirestoreError Thrown if any of the provided DocumentReferences target a different project or database than the pipeline.

PipelineSource.database()

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.

Returns all documents from the entire database.

Signature:

database(): PipelineType;

Returns:

PipelineType

PipelineSource.database()

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.

Returns all documents from the entire database.

Signature:

database(options: DatabaseStageOptions): PipelineType;

Parameters

Parameter Type Description
options DatabaseStageOptions Options defining how a DatabaseStage is evaluated.

Returns:

PipelineType

PipelineSource.documents()

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.

Set the pipeline's source to the documents specified by the given paths and DocumentReferences.

Signature:

documents(docs: Array<string | DocumentReference>): PipelineType;

Parameters

Parameter Type Description
docs Array<string | DocumentReference> An array of paths and DocumentReferences specifying the individual documents that will be the source of this pipeline. The converters for these DocumentReferences will be ignored and not have an effect on this pipeline.

Returns:

PipelineType

Exceptions

FirestoreError Thrown if any of the provided DocumentReferences target a different project or database than the pipeline.

PipelineSource.documents()

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.

Set the pipeline's source to the documents specified by the given paths and DocumentReferences.

Signature:

documents(options: DocumentsStageOptions): PipelineType;

Parameters

Parameter Type Description
options DocumentsStageOptions Options defining how this DocumentsStage is evaluated.

Returns:

PipelineType

Exceptions

FirestoreError Thrown if any of the provided DocumentReferences target a different project or database than the pipeline.