Represents the results of a Firestore pipeline execution.
A PipelineSnapshot contains zero or more PipelineResult objects representing the documents returned by a pipeline query. It provides methods to iterate over the documents and access metadata about the query results.
Signature:
export declare class PipelineSnapshot
Constructors
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(pipeline, results, executionTime) | Constructs a new instance of the PipelineSnapshot class |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| executionTime | Timestamp | The time at which the pipeline producing this result is executed. | |
| results | PipelineResult[] | An array of all the results in the PipelineSnapshot. |
PipelineSnapshot.(constructor)
Constructs a new instance of the PipelineSnapshot class
Signature:
constructor(pipeline: Pipeline, results: PipelineResult[], executionTime?: Timestamp);
Parameters
| Parameter | Type | Description |
|---|---|---|
| pipeline | Pipeline | |
| results | PipelineResult[] | |
| executionTime | Timestamp |
PipelineSnapshot.executionTime
The time at which the pipeline producing this result is executed.
Signature:
get executionTime(): Timestamp;
PipelineSnapshot.results
An array of all the results in the PipelineSnapshot.
Signature:
get results(): PipelineResult[];
Example
const snapshot: PipelineSnapshot = await firestore
.pipeline()
.collection('myCollection')
.where(field('value').greaterThan(10))
.execute();
snapshot.results.forEach(doc => {
console.log(doc.id, '=>', doc.data());
});