docs-devsite/firestore_pipelines.pipelinesnapshot.md
Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference
{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}
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.
<b>Signature:</b>
export declare class PipelineSnapshot
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(pipeline, results, executionTime) | Constructs a new instance of the <code>PipelineSnapshot</code> class |
| 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 <code>PipelineSnapshot</code>. |
Constructs a new instance of the PipelineSnapshot class
<b>Signature:</b>
constructor(pipeline: Pipeline, results: PipelineResult[], executionTime?: Timestamp);
| Parameter | Type | Description |
|---|---|---|
| pipeline | Pipeline | |
| results | PipelineResult<!-- -->[] | |
| executionTime | Timestamp |
The time at which the pipeline producing this result is executed.
<b>Signature:</b>
get executionTime(): Timestamp;
An array of all the results in the PipelineSnapshot<!-- -->.
<b>Signature:</b>
get results(): PipelineResult[];
const snapshot: PipelineSnapshot = await firestore
.pipeline()
.collection('myCollection')
.where(field('value').greaterThan(10))
.execute();
snapshot.results.forEach(doc => {
console.log(doc.id, '=>', doc.data());
});