Executes a pipeline query.
HTTP request
POST https://firestore.googleapis.com/v1beta1/{database=projects/*/databases/*}/documents:executePipeline
The URL uses gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
database |
Required. Database identifier, in the form |
Request body
The request body contains data with the following structure:
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field
|
|
structuredPipeline |
A pipelined operation. |
Union field consistency_selector. Optional consistency arguments, defaults to strong consistency. consistency_selector can be only one of the following: |
|
transaction |
Run the query within an already active transaction. The value here is the opaque transaction ID to execute the query in. A base64-encoded string. |
newTransaction |
Execute the pipeline in a new transaction. The identifier of the newly created transaction will be returned in the first response on the stream. This defaults to a read-only transaction. |
readTime |
Execute the pipeline in a snapshot transaction at the given time. This must be a microsecond precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can additionally be a whole minute timestamp within the past 7 days. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
Response body
The response for [Firestore.Execute][].
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{ "transaction": string, "results": [ { object ( |
| Fields | |
|---|---|
transaction |
Newly created transaction identifier. This field is only specified as part of the first response from the server, alongside the A base64-encoded string. |
results[] |
An ordered batch of results returned executing a pipeline. The batch size is variable, and can even be zero for when only a partial progress message is returned. The fields present in the returned documents are only those that were explicitly requested in the pipeline, this includes those like |
executionTime |
The time at which the results are valid. This is a (not strictly) monotonically increasing value across multiple responses in the same stream. The API guarantees that all previously returned results are still valid at the latest If the query returns no results, a response with Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
explainStats |
Query explain stats. This is present on the last response if the request configured explain to run in 'analyze' or 'explain' mode in the pipeline options. If the query does not return any results, a response with |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/datastorehttps://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
StructuredPipeline
A Firestore query represented as an ordered list of operations / stages.
This is considered the top-level function which plans and executes a query. It is logically equivalent to query(stages, options), but prevents the client from having to build a function wrapper.
| JSON representation |
|---|
{ "pipeline": { object ( |
| Fields | |
|---|---|
pipeline |
Required. The pipeline query to execute. |
options |
Optional. Optional query-level arguments. An object containing a list of |
ExplainStats
Pipeline explain stats.
Depending on the explain options in the original request, this can contain the optimized plan and / or execution stats.
| JSON representation |
|---|
{ "data": { "@type": string, field1: ..., ... } } |
| Fields | |
|---|---|
data |
The format depends on the Currently there are two supported options: An object containing fields of an arbitrary type. An additional field |