Provides the entry point for defining the data source of a Firestore [Pipeline](https://firebase.google.com/docs/reference/js/firestore_pipelines.pipeline#pipeline_class).

Use the methods of this class (e.g., [PipelineSource.collection()](https://firebase.google.com/docs/reference/js/firestore_pipelines.pipelinesource#pipelinesourcecollection), [PipelineSource.collectionGroup()](https://firebase.google.com/docs/reference/js/firestore_pipelines.pipelinesource#pipelinesourcecollectiongroup), [PipelineSource.database()](https://firebase.google.com/docs/reference/js/firestore_pipelines.pipelinesource#pipelinesourcedatabase), or [PipelineSource.documents()](https://firebase.google.com/docs/reference/js/firestore_pipelines.pipelinesource#pipelinesourcedocuments)) 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)](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines.pipelinesource#pipelinesourcecollection) |   | Returns all documents from the entire collection. The collection can be nested. |
| [collection(options)](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines.pipelinesource#pipelinesourcecollection) |   | Returns all documents from the entire collection. The collection can be nested. |
| [collectionGroup(collectionId)](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines.pipelinesource#pipelinesourcecollectiongroup) |   | Returns all documents from a collection ID regardless of the parent. |
| [collectionGroup(options)](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines.pipelinesource#pipelinesourcecollectiongroup) |   | Returns all documents from a collection ID regardless of the parent. |
| [createFrom(query)](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines.pipelinesource#pipelinesourcecreatefrom) |   | Convert the given Query into an equivalent Pipeline. |
| [database()](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines.pipelinesource#pipelinesourcedatabase) |   | Returns all documents from the entire database. |
| [database(options)](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines.pipelinesource#pipelinesourcedatabase) |   | Returns all documents from the entire database. |
| [documents(docs)](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines.pipelinesource#pipelinesourcedocuments) |   | Set the pipeline's source to the documents specified by the given paths and DocumentReferences. |
| [documents(options)](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines.pipelinesource#pipelinesourcedocuments) |   | Set the pipeline's source to the documents specified by the given paths and DocumentReferences. |
| [literals(documents)](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines.pipelinesource#pipelinesourceliterals) |   | Set the pipeline's source to the documents specified by the given array of literal objects.Each object in the array represents a document where keys are field names and values are constants or [Expression](https://firebase.google.com/docs/reference/js/firestore_pipelines.expression#expression_class) instances. |
| [literals(options)](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines.pipelinesource#pipelinesourceliterals) |   | Set the pipeline's source to the documents specified by the given [LiteralsStageOptions](https://firebase.google.com/docs/reference/js/firestore_pipelines#literalsstageoptions). |

## PipelineSource.collection()

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

**Signature:**

    collection(collection: string | CollectionReference): PipelineType;

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| collection | string \| [CollectionReference](https://firebase.google.com/docs/reference/js/firestore.collectionreference#collectionreference_class) | Name or reference to the collection that will be used as the Pipeline source. |

**Returns:**

PipelineType

## PipelineSource.collection()

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

**Signature:**

    collection(options: CollectionStageOptions): PipelineType;

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| options | [CollectionStageOptions](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines#collectionstageoptions) | Options defining how this CollectionStage is evaluated. |

**Returns:**

PipelineType

## PipelineSource.collectionGroup()

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()

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

**Signature:**

    collectionGroup(options: CollectionGroupStageOptions): PipelineType;

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| options | [CollectionGroupStageOptions](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines#collectiongroupstageoptions) | Options defining how this CollectionGroupStage is evaluated. |

**Returns:**

PipelineType

## PipelineSource.createFrom()

Convert the given Query into an equivalent Pipeline.

**Signature:**

    createFrom(query: Query): PipelineType;

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| query | [Query](https://firebase.google.com/docs/reference/js/firestore.query#query_class) | A Query to be converted into a Pipeline. |

**Returns:**

PipelineType

#### Exceptions

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

## PipelineSource.database()

Returns all documents from the entire database.

**Signature:**

    database(): PipelineType;

**Returns:**

PipelineType

## PipelineSource.database()

Returns all documents from the entire database.

**Signature:**

    database(options: DatabaseStageOptions): PipelineType;

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| options | [DatabaseStageOptions](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines#databasestageoptions) | Options defining how a DatabaseStage is evaluated. |

**Returns:**

PipelineType

## PipelineSource.documents()

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](https://firebase.google.com/docs/reference/js/firestore.documentreference#documentreference_class)\> | 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()

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](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines#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.

## PipelineSource.literals()

Set the pipeline's source to the documents specified by the given array of literal objects.

Each object in the array represents a document where keys are field names and values are constants or [Expression](https://firebase.google.com/docs/reference/js/firestore_pipelines.expression#expression_class) instances.

**Signature:**

    literals(documents: Array<Record<string, unknown>>): PipelineType;

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| documents | Array\<Record\<string, unknown\>\> | An array of literal document objects. |

**Returns:**

PipelineType

### Example

    firestore.pipeline().literals([
      { name: 'Alice', score: 50 },
      { name: 'Bob', score: add(constant(30), constant(40)) }
    ]);

## PipelineSource.literals()

Set the pipeline's source to the documents specified by the given [LiteralsStageOptions](https://firebase.google.com/docs/reference/js/firestore_pipelines#literalsstageoptions).

**Signature:**

    literals(options: LiteralsStageOptions): PipelineType;

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| options | [LiteralsStageOptions](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines#literalsstageoptions) | Options defining how this `LiteralsStage` is evaluated. |

**Returns:**

PipelineType