Debian Codegraph @

docs/dyn/firestore_v1.projects.databases.documents.html

raw
1 <html><body>
2 <style>
3
4 body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13 }
14
15 body {
16 font-size: 13px;
17 padding: 1em;
18 }
19
20 h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23 }
24
25 h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28 }
29
30 h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34 }
35
36 pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39 }
40
41 pre {
42 margin-top: 0.5em;
43 }
44
45 h1, h2, h3, p {
46 font-family: Arial, sans serif;
47 }
48
49 h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51 }
52
53 .toc_element {
54 margin-top: 0.5em;
55 }
56
57 .firstline {
58 margin-left: 2 em;
59 }
60
61 .method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66 }
67
68 .details {
69 font-weight: bold;
70 font-size: 14px;
71 }
72
73 </style>
74
75 <h1><a href="firestore_v1.html">Cloud Firestore API</a> . <a href="firestore_v1.projects.html">projects</a> . <a href="firestore_v1.projects.databases.html">databases</a> . <a href="firestore_v1.projects.databases.documents.html">documents</a></h1>
76 <h2>Instance Methods</h2>
77 <p class="toc_element">
78 <code><a href="#batchGet">batchGet(database, body=None, x__xgafv=None)</a></code></p>
79 <p class="firstline">Gets multiple documents. Documents returned by this method are not guaranteed to be returned in the same order that they were requested.</p>
80 <p class="toc_element">
81 <code><a href="#batchWrite">batchWrite(database, body=None, x__xgafv=None)</a></code></p>
82 <p class="firstline">Applies a batch of write operations. The BatchWrite method does not apply the write operations atomically and can apply them out of order. Method does not allow more than one write per document. Each write succeeds or fails independently. See the BatchWriteResponse for the success status of each write. If you require an atomically applied set of writes, use Commit instead.</p>
83 <p class="toc_element">
84 <code><a href="#beginTransaction">beginTransaction(database, body=None, x__xgafv=None)</a></code></p>
85 <p class="firstline">Starts a new transaction.</p>
86 <p class="toc_element">
87 <code><a href="#close">close()</a></code></p>
88 <p class="firstline">Close httplib2 connections.</p>
89 <p class="toc_element">
90 <code><a href="#commit">commit(database, body=None, x__xgafv=None)</a></code></p>
91 <p class="firstline">Commits a transaction, while optionally updating documents.</p>
92 <p class="toc_element">
93 <code><a href="#createDocument">createDocument(parent, collectionId, body=None, documentId=None, mask_fieldPaths=None, x__xgafv=None)</a></code></p>
94 <p class="firstline">Creates a new document.</p>
95 <p class="toc_element">
96 <code><a href="#delete">delete(name, currentDocument_exists=None, currentDocument_updateTime=None, x__xgafv=None)</a></code></p>
97 <p class="firstline">Deletes a document.</p>
98 <p class="toc_element">
99 <code><a href="#executePipeline">executePipeline(database, body=None, x__xgafv=None)</a></code></p>
100 <p class="firstline">Executes a pipeline query.</p>
101 <p class="toc_element">
102 <code><a href="#get">get(name, mask_fieldPaths=None, readTime=None, transaction=None, x__xgafv=None)</a></code></p>
103 <p class="firstline">Gets a single document.</p>
104 <p class="toc_element">
105 <code><a href="#list">list(parent, collectionId, mask_fieldPaths=None, orderBy=None, pageSize=None, pageToken=None, readTime=None, showMissing=None, transaction=None, x__xgafv=None)</a></code></p>
106 <p class="firstline">Lists documents.</p>
107 <p class="toc_element">
108 <code><a href="#listCollectionIds">listCollectionIds(parent, body=None, x__xgafv=None)</a></code></p>
109 <p class="firstline">Lists all the collection IDs underneath a document.</p>
110 <p class="toc_element">
111 <code><a href="#listCollectionIds_next">listCollectionIds_next()</a></code></p>
112 <p class="firstline">Retrieves the next page of results.</p>
113 <p class="toc_element">
114 <code><a href="#listDocuments">listDocuments(parent, collectionId, mask_fieldPaths=None, orderBy=None, pageSize=None, pageToken=None, readTime=None, showMissing=None, transaction=None, x__xgafv=None)</a></code></p>
115 <p class="firstline">Lists documents.</p>
116 <p class="toc_element">
117 <code><a href="#listDocuments_next">listDocuments_next()</a></code></p>
118 <p class="firstline">Retrieves the next page of results.</p>
119 <p class="toc_element">
120 <code><a href="#list_next">list_next()</a></code></p>
121 <p class="firstline">Retrieves the next page of results.</p>
122 <p class="toc_element">
123 <code><a href="#listen">listen(database, body=None, x__xgafv=None)</a></code></p>
124 <p class="firstline">Listens to changes. This method is only available via gRPC or WebChannel (not REST).</p>
125 <p class="toc_element">
126 <code><a href="#partitionQuery">partitionQuery(parent, body=None, x__xgafv=None)</a></code></p>
127 <p class="firstline">Partitions a query by returning partition cursors that can be used to run the query in parallel. The returned partition cursors are split points that can be used by RunQuery as starting/end points for the query results.</p>
128 <p class="toc_element">
129 <code><a href="#partitionQuery_next">partitionQuery_next()</a></code></p>
130 <p class="firstline">Retrieves the next page of results.</p>
131 <p class="toc_element">
132 <code><a href="#patch">patch(name, body=None, currentDocument_exists=None, currentDocument_updateTime=None, mask_fieldPaths=None, updateMask_fieldPaths=None, x__xgafv=None)</a></code></p>
133 <p class="firstline">Updates or inserts a document.</p>
134 <p class="toc_element">
135 <code><a href="#rollback">rollback(database, body=None, x__xgafv=None)</a></code></p>
136 <p class="firstline">Rolls back a transaction.</p>
137 <p class="toc_element">
138 <code><a href="#runAggregationQuery">runAggregationQuery(parent, body=None, x__xgafv=None)</a></code></p>
139 <p class="firstline">Runs an aggregation query. Rather than producing Document results like Firestore.RunQuery, this API allows running an aggregation to produce a series of AggregationResult server-side. High-Level Example: ``` -- Return the number of documents in table given a filter. SELECT COUNT(*) FROM ( SELECT * FROM k where a = true ); ```</p>
140 <p class="toc_element">
141 <code><a href="#runQuery">runQuery(parent, body=None, x__xgafv=None)</a></code></p>
142 <p class="firstline">Runs a query.</p>
143 <p class="toc_element">
144 <code><a href="#write">write(database, body=None, x__xgafv=None)</a></code></p>
145 <p class="firstline">Streams batches of document updates and deletes, in order. This method is only available via gRPC or WebChannel (not REST).</p>
146 <h3>Method Details</h3>
147 <div class="method">
148 <code class="details" id="batchGet">batchGet(database, body=None, x__xgafv=None)</code>
149 <pre>Gets multiple documents. Documents returned by this method are not guaranteed to be returned in the same order that they were requested.
150
151 Args:
152 database: string, Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. (required)
153 body: object, The request body.
154 The object takes the form of:
155
156 { # The request for Firestore.BatchGetDocuments.
157 &quot;documents&quot;: [ # The names of the documents to retrieve. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. The request will fail if any of the document is not a child resource of the given `database`. Duplicate names will be elided.
158 &quot;A String&quot;,
159 ],
160 &quot;mask&quot;: { # A set of field paths on a document. Used to restrict a get or update operation on a document to a subset of its fields. This is different from standard field masks, as this is always scoped to a Document, and takes in account the dynamic nature of Value. # The fields to return. If not set, returns all fields. If a document has a field that is not present in this mask, that field will not be returned in the response.
161 &quot;fieldPaths&quot;: [ # The list of field paths in the mask. See Document.fields for a field path syntax reference.
162 &quot;A String&quot;,
163 ],
164 },
165 &quot;newTransaction&quot;: { # Options for creating a new transaction. # Starts a new transaction and reads the documents. Defaults to a read-only transaction. The new transaction ID will be returned as the first response in the stream.
166 &quot;readOnly&quot;: { # Options for a transaction that can only be used to read documents. # The transaction can only be used for read operations.
167 &quot;readTime&quot;: &quot;A String&quot;, # Reads documents 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.
168 },
169 &quot;readWrite&quot;: { # Options for a transaction that can be used to read and write documents. # The transaction can be used for both read and write operations.
170 &quot;concurrencyMode&quot;: &quot;A String&quot;, # Optional. The concurrency control mode to use for this transaction. A database is able to use different concurrency modes for different transactions simultaneously. 3rd party auth requests are only allowed to create optimistic read-write transactions and must specify that here even if the database-level setting is already configured to optimistic.
171 &quot;retryTransaction&quot;: &quot;A String&quot;, # An optional transaction to retry.
172 },
173 },
174 &quot;readTime&quot;: &quot;A String&quot;, # Reads documents as they were 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.
175 &quot;transaction&quot;: &quot;A String&quot;, # Reads documents in a transaction.
176 }
177
178 x__xgafv: string, V1 error format.
179 Allowed values
180 1 - v1 error format
181 2 - v2 error format
182
183 Returns:
184 An object of the form:
185
186 { # The streamed response for Firestore.BatchGetDocuments.
187 &quot;found&quot;: { # A Firestore document. Must not exceed 1 MiB - 4 bytes. # A document that was requested.
188 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was created. This value increases monotonically when a document is deleted then recreated. It can also be compared to values from other documents and the `read_time` of a query.
189 &quot;fields&quot;: { # The document&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The field names, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. Field paths may be used in other contexts to refer to structured fields defined here. For `map_value`, the field path is represented by a dot-delimited (`.`) string of segments. Each segment is either a simple field name (defined below) or a quoted field name. For example, the structured field `&quot;foo&quot; : { map_value: { &quot;x&amp;y&quot; : { string_value: &quot;hello&quot; }}}` would be represented by the field path `` foo.`x&amp;y` ``. A simple field name contains only characters `a` to `z`, `A` to `Z`, `0` to `9`, or `_`, and must not start with `0` to `9`. For example, `foo_bar_17`. A quoted field name starts and ends with `` ` `` and may contain any character. Some characters, including `` ` ``, must be escaped using a `\`. For example, `` `x&amp;y` `` represents `x&amp;y` and `` `bak\`tik` `` represents `` bak`tik ``.
190 &quot;a_key&quot;: { # A message that can hold any of the supported value types.
191 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
192 &quot;values&quot;: [ # Values in the array.
193 # Object with schema name: Value
194 ],
195 },
196 &quot;booleanValue&quot;: True or False, # A boolean value.
197 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
198 &quot;doubleValue&quot;: 3.14, # A double value.
199 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
200 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
201 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
202 # Object with schema name: Value
203 ],
204 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
205 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
206 &quot;a_key&quot;: # Object with schema name: Value
207 },
208 },
209 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
210 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
211 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
212 },
213 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
214 &quot;mapValue&quot;: { # A map value. # A map value.
215 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
216 &quot;a_key&quot;: # Object with schema name: Value
217 },
218 },
219 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
220 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
221 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
222 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
223 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
224 # Object with schema name: Value
225 ],
226 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
227 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
228 &quot;a_key&quot;: # Object with schema name: Value
229 },
230 },
231 ],
232 },
233 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
234 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
235 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
236 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
237 },
238 },
239 &quot;name&quot;: &quot;A String&quot;, # The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
240 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was last changed. This value is initially set to the `create_time` then increases monotonically with each change to the document. It can also be compared to values from other documents and the `read_time` of a query.
241 },
242 &quot;missing&quot;: &quot;A String&quot;, # A document name that was requested but does not exist. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
243 &quot;readTime&quot;: &quot;A String&quot;, # The time at which the document was read. This may be monotically increasing, in this case the previous documents in the result stream are guaranteed not to have changed between their read_time and this one.
244 &quot;transaction&quot;: &quot;A String&quot;, # The transaction that was started as part of this request. Will only be set in the first response, and only if BatchGetDocumentsRequest.new_transaction was set in the request.
245 }</pre>
246 </div>
247
248 <div class="method">
249 <code class="details" id="batchWrite">batchWrite(database, body=None, x__xgafv=None)</code>
250 <pre>Applies a batch of write operations. The BatchWrite method does not apply the write operations atomically and can apply them out of order. Method does not allow more than one write per document. Each write succeeds or fails independently. See the BatchWriteResponse for the success status of each write. If you require an atomically applied set of writes, use Commit instead.
251
252 Args:
253 database: string, Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. (required)
254 body: object, The request body.
255 The object takes the form of:
256
257 { # The request for Firestore.BatchWrite.
258 &quot;labels&quot;: { # Labels associated with this batch write.
259 &quot;a_key&quot;: &quot;A String&quot;,
260 },
261 &quot;writes&quot;: [ # The writes to apply. Method does not apply writes atomically and does not guarantee ordering. Each write succeeds or fails independently. You cannot write to the same document more than once per request.
262 { # A write on a document.
263 &quot;currentDocument&quot;: { # A precondition on a document, used for conditional operations. # An optional precondition on the document. The write will fail if this is set and not met by the target document.
264 &quot;exists&quot;: True or False, # When set to `true`, the target document must exist. When set to `false`, the target document must not exist.
265 &quot;updateTime&quot;: &quot;A String&quot;, # When set, the target document must exist and have been last updated at that time. Timestamp must be microsecond aligned.
266 },
267 &quot;delete&quot;: &quot;A String&quot;, # A document name to delete. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
268 &quot;transform&quot;: { # A transformation of a document. # Applies a transformation to a document.
269 &quot;document&quot;: &quot;A String&quot;, # The name of the document to transform.
270 &quot;fieldTransforms&quot;: [ # The list of transformations to apply to the fields of the document, in order. This must not be empty.
271 { # A transformation of a field of the document.
272 &quot;appendMissingElements&quot;: { # An array value. # Append the given elements in order if they are not already present in the current field value. If the field is not an array, or if the field does not yet exist, it is first set to the empty array. Equivalent numbers of different types (e.g. 3L and 3.0) are considered equal when checking if a value is missing. NaN is equal to NaN, and Null is equal to Null. If the input contains multiple equivalent values, only the first will be considered. The corresponding transform_result will be the null value.
273 &quot;values&quot;: [ # Values in the array.
274 # Object with schema name: Value
275 ],
276 },
277 &quot;fieldPath&quot;: &quot;A String&quot;, # The path of the field. See Document.fields for the field path syntax reference.
278 &quot;increment&quot;: { # A message that can hold any of the supported value types. # Adds the given value to the field&#x27;s current value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the given value. If either of the given value or the current field value are doubles, both values will be interpreted as doubles. Double arithmetic and representation of double values follow IEEE 754 semantics. If there is positive/negative integer overflow, the field is resolved to the largest magnitude positive/negative integer.
279 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
280 &quot;values&quot;: [ # Values in the array.
281 # Object with schema name: Value
282 ],
283 },
284 &quot;booleanValue&quot;: True or False, # A boolean value.
285 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
286 &quot;doubleValue&quot;: 3.14, # A double value.
287 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
288 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
289 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
290 # Object with schema name: Value
291 ],
292 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
293 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
294 &quot;a_key&quot;: # Object with schema name: Value
295 },
296 },
297 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
298 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
299 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
300 },
301 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
302 &quot;mapValue&quot;: { # A map value. # A map value.
303 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
304 &quot;a_key&quot;: # Object with schema name: Value
305 },
306 },
307 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
308 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
309 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
310 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
311 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
312 # Object with schema name: Value
313 ],
314 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
315 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
316 &quot;a_key&quot;: # Object with schema name: Value
317 },
318 },
319 ],
320 },
321 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
322 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
323 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
324 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
325 },
326 &quot;maximum&quot;: { # A message that can hold any of the supported value types. # Sets the field to the maximum of its current value and the given value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the given value. If a maximum operation is applied where the field and the input value are of mixed types (that is - one is an integer and one is a double) the field takes on the type of the larger operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not change. 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and zero input value is always the stored value. The maximum of any numeric value x and NaN is NaN.
327 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
328 &quot;values&quot;: [ # Values in the array.
329 # Object with schema name: Value
330 ],
331 },
332 &quot;booleanValue&quot;: True or False, # A boolean value.
333 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
334 &quot;doubleValue&quot;: 3.14, # A double value.
335 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
336 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
337 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
338 # Object with schema name: Value
339 ],
340 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
341 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
342 &quot;a_key&quot;: # Object with schema name: Value
343 },
344 },
345 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
346 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
347 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
348 },
349 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
350 &quot;mapValue&quot;: { # A map value. # A map value.
351 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
352 &quot;a_key&quot;: # Object with schema name: Value
353 },
354 },
355 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
356 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
357 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
358 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
359 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
360 # Object with schema name: Value
361 ],
362 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
363 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
364 &quot;a_key&quot;: # Object with schema name: Value
365 },
366 },
367 ],
368 },
369 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
370 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
371 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
372 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
373 },
374 &quot;minimum&quot;: { # A message that can hold any of the supported value types. # Sets the field to the minimum of its current value and the given value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the input value. If a minimum operation is applied where the field and the input value are of mixed types (that is - one is an integer and one is a double) the field takes on the type of the smaller operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not change. 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and zero input value is always the stored value. The minimum of any numeric value x and NaN is NaN.
375 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
376 &quot;values&quot;: [ # Values in the array.
377 # Object with schema name: Value
378 ],
379 },
380 &quot;booleanValue&quot;: True or False, # A boolean value.
381 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
382 &quot;doubleValue&quot;: 3.14, # A double value.
383 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
384 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
385 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
386 # Object with schema name: Value
387 ],
388 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
389 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
390 &quot;a_key&quot;: # Object with schema name: Value
391 },
392 },
393 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
394 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
395 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
396 },
397 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
398 &quot;mapValue&quot;: { # A map value. # A map value.
399 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
400 &quot;a_key&quot;: # Object with schema name: Value
401 },
402 },
403 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
404 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
405 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
406 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
407 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
408 # Object with schema name: Value
409 ],
410 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
411 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
412 &quot;a_key&quot;: # Object with schema name: Value
413 },
414 },
415 ],
416 },
417 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
418 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
419 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
420 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
421 },
422 &quot;removeAllFromArray&quot;: { # An array value. # Remove all of the given elements from the array in the field. If the field is not an array, or if the field does not yet exist, it is set to the empty array. Equivalent numbers of the different types (e.g. 3L and 3.0) are considered equal when deciding whether an element should be removed. NaN is equal to NaN, and Null is equal to Null. This will remove all equivalent values if there are duplicates. The corresponding transform_result will be the null value.
423 &quot;values&quot;: [ # Values in the array.
424 # Object with schema name: Value
425 ],
426 },
427 &quot;setToServerValue&quot;: &quot;A String&quot;, # Sets the field to the given server value.
428 },
429 ],
430 },
431 &quot;update&quot;: { # A Firestore document. Must not exceed 1 MiB - 4 bytes. # A document to write.
432 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was created. This value increases monotonically when a document is deleted then recreated. It can also be compared to values from other documents and the `read_time` of a query.
433 &quot;fields&quot;: { # The document&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The field names, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. Field paths may be used in other contexts to refer to structured fields defined here. For `map_value`, the field path is represented by a dot-delimited (`.`) string of segments. Each segment is either a simple field name (defined below) or a quoted field name. For example, the structured field `&quot;foo&quot; : { map_value: { &quot;x&amp;y&quot; : { string_value: &quot;hello&quot; }}}` would be represented by the field path `` foo.`x&amp;y` ``. A simple field name contains only characters `a` to `z`, `A` to `Z`, `0` to `9`, or `_`, and must not start with `0` to `9`. For example, `foo_bar_17`. A quoted field name starts and ends with `` ` `` and may contain any character. Some characters, including `` ` ``, must be escaped using a `\`. For example, `` `x&amp;y` `` represents `x&amp;y` and `` `bak\`tik` `` represents `` bak`tik ``.
434 &quot;a_key&quot;: { # A message that can hold any of the supported value types.
435 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
436 &quot;values&quot;: [ # Values in the array.
437 # Object with schema name: Value
438 ],
439 },
440 &quot;booleanValue&quot;: True or False, # A boolean value.
441 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
442 &quot;doubleValue&quot;: 3.14, # A double value.
443 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
444 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
445 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
446 # Object with schema name: Value
447 ],
448 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
449 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
450 &quot;a_key&quot;: # Object with schema name: Value
451 },
452 },
453 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
454 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
455 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
456 },
457 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
458 &quot;mapValue&quot;: { # A map value. # A map value.
459 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
460 &quot;a_key&quot;: # Object with schema name: Value
461 },
462 },
463 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
464 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
465 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
466 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
467 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
468 # Object with schema name: Value
469 ],
470 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
471 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
472 &quot;a_key&quot;: # Object with schema name: Value
473 },
474 },
475 ],
476 },
477 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
478 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
479 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
480 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
481 },
482 },
483 &quot;name&quot;: &quot;A String&quot;, # The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
484 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was last changed. This value is initially set to the `create_time` then increases monotonically with each change to the document. It can also be compared to values from other documents and the `read_time` of a query.
485 },
486 &quot;updateMask&quot;: { # A set of field paths on a document. Used to restrict a get or update operation on a document to a subset of its fields. This is different from standard field masks, as this is always scoped to a Document, and takes in account the dynamic nature of Value. # The fields to update in this write. This field can be set only when the operation is `update`. If the mask is not set for an `update` and the document exists, any existing data will be overwritten. If the mask is set and the document on the server has fields not covered by the mask, they are left unchanged. Fields referenced in the mask, but not present in the input document, are deleted from the document on the server. The field paths in this mask must not contain a reserved field name.
487 &quot;fieldPaths&quot;: [ # The list of field paths in the mask. See Document.fields for a field path syntax reference.
488 &quot;A String&quot;,
489 ],
490 },
491 &quot;updateTransforms&quot;: [ # The transforms to perform after update. This field can be set only when the operation is `update`. If present, this write is equivalent to performing `update` and `transform` to the same document atomically and in order.
492 { # A transformation of a field of the document.
493 &quot;appendMissingElements&quot;: { # An array value. # Append the given elements in order if they are not already present in the current field value. If the field is not an array, or if the field does not yet exist, it is first set to the empty array. Equivalent numbers of different types (e.g. 3L and 3.0) are considered equal when checking if a value is missing. NaN is equal to NaN, and Null is equal to Null. If the input contains multiple equivalent values, only the first will be considered. The corresponding transform_result will be the null value.
494 &quot;values&quot;: [ # Values in the array.
495 # Object with schema name: Value
496 ],
497 },
498 &quot;fieldPath&quot;: &quot;A String&quot;, # The path of the field. See Document.fields for the field path syntax reference.
499 &quot;increment&quot;: { # A message that can hold any of the supported value types. # Adds the given value to the field&#x27;s current value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the given value. If either of the given value or the current field value are doubles, both values will be interpreted as doubles. Double arithmetic and representation of double values follow IEEE 754 semantics. If there is positive/negative integer overflow, the field is resolved to the largest magnitude positive/negative integer.
500 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
501 &quot;values&quot;: [ # Values in the array.
502 # Object with schema name: Value
503 ],
504 },
505 &quot;booleanValue&quot;: True or False, # A boolean value.
506 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
507 &quot;doubleValue&quot;: 3.14, # A double value.
508 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
509 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
510 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
511 # Object with schema name: Value
512 ],
513 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
514 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
515 &quot;a_key&quot;: # Object with schema name: Value
516 },
517 },
518 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
519 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
520 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
521 },
522 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
523 &quot;mapValue&quot;: { # A map value. # A map value.
524 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
525 &quot;a_key&quot;: # Object with schema name: Value
526 },
527 },
528 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
529 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
530 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
531 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
532 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
533 # Object with schema name: Value
534 ],
535 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
536 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
537 &quot;a_key&quot;: # Object with schema name: Value
538 },
539 },
540 ],
541 },
542 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
543 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
544 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
545 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
546 },
547 &quot;maximum&quot;: { # A message that can hold any of the supported value types. # Sets the field to the maximum of its current value and the given value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the given value. If a maximum operation is applied where the field and the input value are of mixed types (that is - one is an integer and one is a double) the field takes on the type of the larger operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not change. 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and zero input value is always the stored value. The maximum of any numeric value x and NaN is NaN.
548 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
549 &quot;values&quot;: [ # Values in the array.
550 # Object with schema name: Value
551 ],
552 },
553 &quot;booleanValue&quot;: True or False, # A boolean value.
554 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
555 &quot;doubleValue&quot;: 3.14, # A double value.
556 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
557 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
558 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
559 # Object with schema name: Value
560 ],
561 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
562 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
563 &quot;a_key&quot;: # Object with schema name: Value
564 },
565 },
566 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
567 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
568 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
569 },
570 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
571 &quot;mapValue&quot;: { # A map value. # A map value.
572 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
573 &quot;a_key&quot;: # Object with schema name: Value
574 },
575 },
576 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
577 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
578 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
579 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
580 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
581 # Object with schema name: Value
582 ],
583 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
584 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
585 &quot;a_key&quot;: # Object with schema name: Value
586 },
587 },
588 ],
589 },
590 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
591 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
592 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
593 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
594 },
595 &quot;minimum&quot;: { # A message that can hold any of the supported value types. # Sets the field to the minimum of its current value and the given value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the input value. If a minimum operation is applied where the field and the input value are of mixed types (that is - one is an integer and one is a double) the field takes on the type of the smaller operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not change. 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and zero input value is always the stored value. The minimum of any numeric value x and NaN is NaN.
596 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
597 &quot;values&quot;: [ # Values in the array.
598 # Object with schema name: Value
599 ],
600 },
601 &quot;booleanValue&quot;: True or False, # A boolean value.
602 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
603 &quot;doubleValue&quot;: 3.14, # A double value.
604 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
605 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
606 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
607 # Object with schema name: Value
608 ],
609 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
610 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
611 &quot;a_key&quot;: # Object with schema name: Value
612 },
613 },
614 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
615 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
616 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
617 },
618 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
619 &quot;mapValue&quot;: { # A map value. # A map value.
620 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
621 &quot;a_key&quot;: # Object with schema name: Value
622 },
623 },
624 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
625 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
626 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
627 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
628 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
629 # Object with schema name: Value
630 ],
631 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
632 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
633 &quot;a_key&quot;: # Object with schema name: Value
634 },
635 },
636 ],
637 },
638 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
639 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
640 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
641 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
642 },
643 &quot;removeAllFromArray&quot;: { # An array value. # Remove all of the given elements from the array in the field. If the field is not an array, or if the field does not yet exist, it is set to the empty array. Equivalent numbers of the different types (e.g. 3L and 3.0) are considered equal when deciding whether an element should be removed. NaN is equal to NaN, and Null is equal to Null. This will remove all equivalent values if there are duplicates. The corresponding transform_result will be the null value.
644 &quot;values&quot;: [ # Values in the array.
645 # Object with schema name: Value
646 ],
647 },
648 &quot;setToServerValue&quot;: &quot;A String&quot;, # Sets the field to the given server value.
649 },
650 ],
651 },
652 ],
653 }
654
655 x__xgafv: string, V1 error format.
656 Allowed values
657 1 - v1 error format
658 2 - v2 error format
659
660 Returns:
661 An object of the form:
662
663 { # The response from Firestore.BatchWrite.
664 &quot;status&quot;: [ # The status of applying the writes. This i-th write status corresponds to the i-th write in the request.
665 { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
666 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
667 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
668 {
669 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
670 },
671 ],
672 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
673 },
674 ],
675 &quot;writeResults&quot;: [ # The result of applying the writes. This i-th write result corresponds to the i-th write in the request.
676 { # The result of applying a write.
677 &quot;transformResults&quot;: [ # The results of applying each DocumentTransform.FieldTransform, in the same order.
678 { # A message that can hold any of the supported value types.
679 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
680 &quot;values&quot;: [ # Values in the array.
681 # Object with schema name: Value
682 ],
683 },
684 &quot;booleanValue&quot;: True or False, # A boolean value.
685 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
686 &quot;doubleValue&quot;: 3.14, # A double value.
687 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
688 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
689 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
690 # Object with schema name: Value
691 ],
692 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
693 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
694 &quot;a_key&quot;: # Object with schema name: Value
695 },
696 },
697 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
698 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
699 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
700 },
701 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
702 &quot;mapValue&quot;: { # A map value. # A map value.
703 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
704 &quot;a_key&quot;: # Object with schema name: Value
705 },
706 },
707 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
708 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
709 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
710 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
711 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
712 # Object with schema name: Value
713 ],
714 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
715 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
716 &quot;a_key&quot;: # Object with schema name: Value
717 },
718 },
719 ],
720 },
721 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
722 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
723 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
724 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
725 },
726 ],
727 &quot;updateTime&quot;: &quot;A String&quot;, # The last update time of the document after applying the write. Not set after a `delete`. If the write did not actually change the document, this will be the previous update_time.
728 },
729 ],
730 }</pre>
731 </div>
732
733 <div class="method">
734 <code class="details" id="beginTransaction">beginTransaction(database, body=None, x__xgafv=None)</code>
735 <pre>Starts a new transaction.
736
737 Args:
738 database: string, Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. (required)
739 body: object, The request body.
740 The object takes the form of:
741
742 { # The request for Firestore.BeginTransaction.
743 &quot;options&quot;: { # Options for creating a new transaction. # The options for the transaction. Defaults to a read-write transaction.
744 &quot;readOnly&quot;: { # Options for a transaction that can only be used to read documents. # The transaction can only be used for read operations.
745 &quot;readTime&quot;: &quot;A String&quot;, # Reads documents 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.
746 },
747 &quot;readWrite&quot;: { # Options for a transaction that can be used to read and write documents. # The transaction can be used for both read and write operations.
748 &quot;concurrencyMode&quot;: &quot;A String&quot;, # Optional. The concurrency control mode to use for this transaction. A database is able to use different concurrency modes for different transactions simultaneously. 3rd party auth requests are only allowed to create optimistic read-write transactions and must specify that here even if the database-level setting is already configured to optimistic.
749 &quot;retryTransaction&quot;: &quot;A String&quot;, # An optional transaction to retry.
750 },
751 },
752 }
753
754 x__xgafv: string, V1 error format.
755 Allowed values
756 1 - v1 error format
757 2 - v2 error format
758
759 Returns:
760 An object of the form:
761
762 { # The response for Firestore.BeginTransaction.
763 &quot;transaction&quot;: &quot;A String&quot;, # The transaction that was started.
764 }</pre>
765 </div>
766
767 <div class="method">
768 <code class="details" id="close">close()</code>
769 <pre>Close httplib2 connections.</pre>
770 </div>
771
772 <div class="method">
773 <code class="details" id="commit">commit(database, body=None, x__xgafv=None)</code>
774 <pre>Commits a transaction, while optionally updating documents.
775
776 Args:
777 database: string, Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. (required)
778 body: object, The request body.
779 The object takes the form of:
780
781 { # The request for Firestore.Commit.
782 &quot;transaction&quot;: &quot;A String&quot;, # If set, applies all writes in this transaction, and commits it.
783 &quot;writes&quot;: [ # The writes to apply. Always executed atomically and in order.
784 { # A write on a document.
785 &quot;currentDocument&quot;: { # A precondition on a document, used for conditional operations. # An optional precondition on the document. The write will fail if this is set and not met by the target document.
786 &quot;exists&quot;: True or False, # When set to `true`, the target document must exist. When set to `false`, the target document must not exist.
787 &quot;updateTime&quot;: &quot;A String&quot;, # When set, the target document must exist and have been last updated at that time. Timestamp must be microsecond aligned.
788 },
789 &quot;delete&quot;: &quot;A String&quot;, # A document name to delete. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
790 &quot;transform&quot;: { # A transformation of a document. # Applies a transformation to a document.
791 &quot;document&quot;: &quot;A String&quot;, # The name of the document to transform.
792 &quot;fieldTransforms&quot;: [ # The list of transformations to apply to the fields of the document, in order. This must not be empty.
793 { # A transformation of a field of the document.
794 &quot;appendMissingElements&quot;: { # An array value. # Append the given elements in order if they are not already present in the current field value. If the field is not an array, or if the field does not yet exist, it is first set to the empty array. Equivalent numbers of different types (e.g. 3L and 3.0) are considered equal when checking if a value is missing. NaN is equal to NaN, and Null is equal to Null. If the input contains multiple equivalent values, only the first will be considered. The corresponding transform_result will be the null value.
795 &quot;values&quot;: [ # Values in the array.
796 # Object with schema name: Value
797 ],
798 },
799 &quot;fieldPath&quot;: &quot;A String&quot;, # The path of the field. See Document.fields for the field path syntax reference.
800 &quot;increment&quot;: { # A message that can hold any of the supported value types. # Adds the given value to the field&#x27;s current value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the given value. If either of the given value or the current field value are doubles, both values will be interpreted as doubles. Double arithmetic and representation of double values follow IEEE 754 semantics. If there is positive/negative integer overflow, the field is resolved to the largest magnitude positive/negative integer.
801 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
802 &quot;values&quot;: [ # Values in the array.
803 # Object with schema name: Value
804 ],
805 },
806 &quot;booleanValue&quot;: True or False, # A boolean value.
807 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
808 &quot;doubleValue&quot;: 3.14, # A double value.
809 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
810 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
811 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
812 # Object with schema name: Value
813 ],
814 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
815 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
816 &quot;a_key&quot;: # Object with schema name: Value
817 },
818 },
819 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
820 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
821 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
822 },
823 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
824 &quot;mapValue&quot;: { # A map value. # A map value.
825 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
826 &quot;a_key&quot;: # Object with schema name: Value
827 },
828 },
829 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
830 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
831 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
832 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
833 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
834 # Object with schema name: Value
835 ],
836 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
837 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
838 &quot;a_key&quot;: # Object with schema name: Value
839 },
840 },
841 ],
842 },
843 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
844 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
845 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
846 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
847 },
848 &quot;maximum&quot;: { # A message that can hold any of the supported value types. # Sets the field to the maximum of its current value and the given value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the given value. If a maximum operation is applied where the field and the input value are of mixed types (that is - one is an integer and one is a double) the field takes on the type of the larger operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not change. 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and zero input value is always the stored value. The maximum of any numeric value x and NaN is NaN.
849 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
850 &quot;values&quot;: [ # Values in the array.
851 # Object with schema name: Value
852 ],
853 },
854 &quot;booleanValue&quot;: True or False, # A boolean value.
855 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
856 &quot;doubleValue&quot;: 3.14, # A double value.
857 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
858 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
859 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
860 # Object with schema name: Value
861 ],
862 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
863 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
864 &quot;a_key&quot;: # Object with schema name: Value
865 },
866 },
867 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
868 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
869 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
870 },
871 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
872 &quot;mapValue&quot;: { # A map value. # A map value.
873 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
874 &quot;a_key&quot;: # Object with schema name: Value
875 },
876 },
877 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
878 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
879 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
880 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
881 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
882 # Object with schema name: Value
883 ],
884 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
885 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
886 &quot;a_key&quot;: # Object with schema name: Value
887 },
888 },
889 ],
890 },
891 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
892 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
893 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
894 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
895 },
896 &quot;minimum&quot;: { # A message that can hold any of the supported value types. # Sets the field to the minimum of its current value and the given value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the input value. If a minimum operation is applied where the field and the input value are of mixed types (that is - one is an integer and one is a double) the field takes on the type of the smaller operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not change. 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and zero input value is always the stored value. The minimum of any numeric value x and NaN is NaN.
897 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
898 &quot;values&quot;: [ # Values in the array.
899 # Object with schema name: Value
900 ],
901 },
902 &quot;booleanValue&quot;: True or False, # A boolean value.
903 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
904 &quot;doubleValue&quot;: 3.14, # A double value.
905 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
906 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
907 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
908 # Object with schema name: Value
909 ],
910 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
911 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
912 &quot;a_key&quot;: # Object with schema name: Value
913 },
914 },
915 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
916 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
917 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
918 },
919 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
920 &quot;mapValue&quot;: { # A map value. # A map value.
921 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
922 &quot;a_key&quot;: # Object with schema name: Value
923 },
924 },
925 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
926 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
927 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
928 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
929 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
930 # Object with schema name: Value
931 ],
932 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
933 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
934 &quot;a_key&quot;: # Object with schema name: Value
935 },
936 },
937 ],
938 },
939 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
940 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
941 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
942 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
943 },
944 &quot;removeAllFromArray&quot;: { # An array value. # Remove all of the given elements from the array in the field. If the field is not an array, or if the field does not yet exist, it is set to the empty array. Equivalent numbers of the different types (e.g. 3L and 3.0) are considered equal when deciding whether an element should be removed. NaN is equal to NaN, and Null is equal to Null. This will remove all equivalent values if there are duplicates. The corresponding transform_result will be the null value.
945 &quot;values&quot;: [ # Values in the array.
946 # Object with schema name: Value
947 ],
948 },
949 &quot;setToServerValue&quot;: &quot;A String&quot;, # Sets the field to the given server value.
950 },
951 ],
952 },
953 &quot;update&quot;: { # A Firestore document. Must not exceed 1 MiB - 4 bytes. # A document to write.
954 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was created. This value increases monotonically when a document is deleted then recreated. It can also be compared to values from other documents and the `read_time` of a query.
955 &quot;fields&quot;: { # The document&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The field names, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. Field paths may be used in other contexts to refer to structured fields defined here. For `map_value`, the field path is represented by a dot-delimited (`.`) string of segments. Each segment is either a simple field name (defined below) or a quoted field name. For example, the structured field `&quot;foo&quot; : { map_value: { &quot;x&amp;y&quot; : { string_value: &quot;hello&quot; }}}` would be represented by the field path `` foo.`x&amp;y` ``. A simple field name contains only characters `a` to `z`, `A` to `Z`, `0` to `9`, or `_`, and must not start with `0` to `9`. For example, `foo_bar_17`. A quoted field name starts and ends with `` ` `` and may contain any character. Some characters, including `` ` ``, must be escaped using a `\`. For example, `` `x&amp;y` `` represents `x&amp;y` and `` `bak\`tik` `` represents `` bak`tik ``.
956 &quot;a_key&quot;: { # A message that can hold any of the supported value types.
957 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
958 &quot;values&quot;: [ # Values in the array.
959 # Object with schema name: Value
960 ],
961 },
962 &quot;booleanValue&quot;: True or False, # A boolean value.
963 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
964 &quot;doubleValue&quot;: 3.14, # A double value.
965 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
966 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
967 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
968 # Object with schema name: Value
969 ],
970 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
971 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
972 &quot;a_key&quot;: # Object with schema name: Value
973 },
974 },
975 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
976 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
977 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
978 },
979 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
980 &quot;mapValue&quot;: { # A map value. # A map value.
981 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
982 &quot;a_key&quot;: # Object with schema name: Value
983 },
984 },
985 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
986 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
987 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
988 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
989 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
990 # Object with schema name: Value
991 ],
992 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
993 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
994 &quot;a_key&quot;: # Object with schema name: Value
995 },
996 },
997 ],
998 },
999 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1000 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
1001 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
1002 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
1003 },
1004 },
1005 &quot;name&quot;: &quot;A String&quot;, # The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1006 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was last changed. This value is initially set to the `create_time` then increases monotonically with each change to the document. It can also be compared to values from other documents and the `read_time` of a query.
1007 },
1008 &quot;updateMask&quot;: { # A set of field paths on a document. Used to restrict a get or update operation on a document to a subset of its fields. This is different from standard field masks, as this is always scoped to a Document, and takes in account the dynamic nature of Value. # The fields to update in this write. This field can be set only when the operation is `update`. If the mask is not set for an `update` and the document exists, any existing data will be overwritten. If the mask is set and the document on the server has fields not covered by the mask, they are left unchanged. Fields referenced in the mask, but not present in the input document, are deleted from the document on the server. The field paths in this mask must not contain a reserved field name.
1009 &quot;fieldPaths&quot;: [ # The list of field paths in the mask. See Document.fields for a field path syntax reference.
1010 &quot;A String&quot;,
1011 ],
1012 },
1013 &quot;updateTransforms&quot;: [ # The transforms to perform after update. This field can be set only when the operation is `update`. If present, this write is equivalent to performing `update` and `transform` to the same document atomically and in order.
1014 { # A transformation of a field of the document.
1015 &quot;appendMissingElements&quot;: { # An array value. # Append the given elements in order if they are not already present in the current field value. If the field is not an array, or if the field does not yet exist, it is first set to the empty array. Equivalent numbers of different types (e.g. 3L and 3.0) are considered equal when checking if a value is missing. NaN is equal to NaN, and Null is equal to Null. If the input contains multiple equivalent values, only the first will be considered. The corresponding transform_result will be the null value.
1016 &quot;values&quot;: [ # Values in the array.
1017 # Object with schema name: Value
1018 ],
1019 },
1020 &quot;fieldPath&quot;: &quot;A String&quot;, # The path of the field. See Document.fields for the field path syntax reference.
1021 &quot;increment&quot;: { # A message that can hold any of the supported value types. # Adds the given value to the field&#x27;s current value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the given value. If either of the given value or the current field value are doubles, both values will be interpreted as doubles. Double arithmetic and representation of double values follow IEEE 754 semantics. If there is positive/negative integer overflow, the field is resolved to the largest magnitude positive/negative integer.
1022 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
1023 &quot;values&quot;: [ # Values in the array.
1024 # Object with schema name: Value
1025 ],
1026 },
1027 &quot;booleanValue&quot;: True or False, # A boolean value.
1028 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
1029 &quot;doubleValue&quot;: 3.14, # A double value.
1030 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
1031 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
1032 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
1033 # Object with schema name: Value
1034 ],
1035 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1036 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1037 &quot;a_key&quot;: # Object with schema name: Value
1038 },
1039 },
1040 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
1041 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1042 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1043 },
1044 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
1045 &quot;mapValue&quot;: { # A map value. # A map value.
1046 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
1047 &quot;a_key&quot;: # Object with schema name: Value
1048 },
1049 },
1050 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
1051 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
1052 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
1053 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
1054 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
1055 # Object with schema name: Value
1056 ],
1057 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1058 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1059 &quot;a_key&quot;: # Object with schema name: Value
1060 },
1061 },
1062 ],
1063 },
1064 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1065 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
1066 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
1067 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
1068 },
1069 &quot;maximum&quot;: { # A message that can hold any of the supported value types. # Sets the field to the maximum of its current value and the given value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the given value. If a maximum operation is applied where the field and the input value are of mixed types (that is - one is an integer and one is a double) the field takes on the type of the larger operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not change. 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and zero input value is always the stored value. The maximum of any numeric value x and NaN is NaN.
1070 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
1071 &quot;values&quot;: [ # Values in the array.
1072 # Object with schema name: Value
1073 ],
1074 },
1075 &quot;booleanValue&quot;: True or False, # A boolean value.
1076 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
1077 &quot;doubleValue&quot;: 3.14, # A double value.
1078 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
1079 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
1080 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
1081 # Object with schema name: Value
1082 ],
1083 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1084 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1085 &quot;a_key&quot;: # Object with schema name: Value
1086 },
1087 },
1088 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
1089 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1090 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1091 },
1092 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
1093 &quot;mapValue&quot;: { # A map value. # A map value.
1094 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
1095 &quot;a_key&quot;: # Object with schema name: Value
1096 },
1097 },
1098 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
1099 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
1100 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
1101 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
1102 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
1103 # Object with schema name: Value
1104 ],
1105 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1106 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1107 &quot;a_key&quot;: # Object with schema name: Value
1108 },
1109 },
1110 ],
1111 },
1112 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1113 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
1114 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
1115 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
1116 },
1117 &quot;minimum&quot;: { # A message that can hold any of the supported value types. # Sets the field to the minimum of its current value and the given value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the input value. If a minimum operation is applied where the field and the input value are of mixed types (that is - one is an integer and one is a double) the field takes on the type of the smaller operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not change. 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and zero input value is always the stored value. The minimum of any numeric value x and NaN is NaN.
1118 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
1119 &quot;values&quot;: [ # Values in the array.
1120 # Object with schema name: Value
1121 ],
1122 },
1123 &quot;booleanValue&quot;: True or False, # A boolean value.
1124 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
1125 &quot;doubleValue&quot;: 3.14, # A double value.
1126 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
1127 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
1128 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
1129 # Object with schema name: Value
1130 ],
1131 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1132 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1133 &quot;a_key&quot;: # Object with schema name: Value
1134 },
1135 },
1136 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
1137 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1138 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1139 },
1140 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
1141 &quot;mapValue&quot;: { # A map value. # A map value.
1142 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
1143 &quot;a_key&quot;: # Object with schema name: Value
1144 },
1145 },
1146 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
1147 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
1148 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
1149 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
1150 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
1151 # Object with schema name: Value
1152 ],
1153 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1154 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1155 &quot;a_key&quot;: # Object with schema name: Value
1156 },
1157 },
1158 ],
1159 },
1160 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1161 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
1162 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
1163 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
1164 },
1165 &quot;removeAllFromArray&quot;: { # An array value. # Remove all of the given elements from the array in the field. If the field is not an array, or if the field does not yet exist, it is set to the empty array. Equivalent numbers of the different types (e.g. 3L and 3.0) are considered equal when deciding whether an element should be removed. NaN is equal to NaN, and Null is equal to Null. This will remove all equivalent values if there are duplicates. The corresponding transform_result will be the null value.
1166 &quot;values&quot;: [ # Values in the array.
1167 # Object with schema name: Value
1168 ],
1169 },
1170 &quot;setToServerValue&quot;: &quot;A String&quot;, # Sets the field to the given server value.
1171 },
1172 ],
1173 },
1174 ],
1175 }
1176
1177 x__xgafv: string, V1 error format.
1178 Allowed values
1179 1 - v1 error format
1180 2 - v2 error format
1181
1182 Returns:
1183 An object of the form:
1184
1185 { # The response for Firestore.Commit.
1186 &quot;commitTime&quot;: &quot;A String&quot;, # The time at which the commit occurred. Any read with an equal or greater `read_time` is guaranteed to see the effects of the commit.
1187 &quot;writeResults&quot;: [ # The result of applying the writes. This i-th write result corresponds to the i-th write in the request.
1188 { # The result of applying a write.
1189 &quot;transformResults&quot;: [ # The results of applying each DocumentTransform.FieldTransform, in the same order.
1190 { # A message that can hold any of the supported value types.
1191 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
1192 &quot;values&quot;: [ # Values in the array.
1193 # Object with schema name: Value
1194 ],
1195 },
1196 &quot;booleanValue&quot;: True or False, # A boolean value.
1197 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
1198 &quot;doubleValue&quot;: 3.14, # A double value.
1199 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
1200 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
1201 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
1202 # Object with schema name: Value
1203 ],
1204 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1205 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1206 &quot;a_key&quot;: # Object with schema name: Value
1207 },
1208 },
1209 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
1210 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1211 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1212 },
1213 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
1214 &quot;mapValue&quot;: { # A map value. # A map value.
1215 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
1216 &quot;a_key&quot;: # Object with schema name: Value
1217 },
1218 },
1219 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
1220 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
1221 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
1222 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
1223 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
1224 # Object with schema name: Value
1225 ],
1226 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1227 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1228 &quot;a_key&quot;: # Object with schema name: Value
1229 },
1230 },
1231 ],
1232 },
1233 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1234 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
1235 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
1236 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
1237 },
1238 ],
1239 &quot;updateTime&quot;: &quot;A String&quot;, # The last update time of the document after applying the write. Not set after a `delete`. If the write did not actually change the document, this will be the previous update_time.
1240 },
1241 ],
1242 }</pre>
1243 </div>
1244
1245 <div class="method">
1246 <code class="details" id="createDocument">createDocument(parent, collectionId, body=None, documentId=None, mask_fieldPaths=None, x__xgafv=None)</code>
1247 <pre>Creates a new document.
1248
1249 Args:
1250 parent: string, Required. The parent resource. For example: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` (required)
1251 collectionId: string, Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`. (required)
1252 body: object, The request body.
1253 The object takes the form of:
1254
1255 { # A Firestore document. Must not exceed 1 MiB - 4 bytes.
1256 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was created. This value increases monotonically when a document is deleted then recreated. It can also be compared to values from other documents and the `read_time` of a query.
1257 &quot;fields&quot;: { # The document&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The field names, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. Field paths may be used in other contexts to refer to structured fields defined here. For `map_value`, the field path is represented by a dot-delimited (`.`) string of segments. Each segment is either a simple field name (defined below) or a quoted field name. For example, the structured field `&quot;foo&quot; : { map_value: { &quot;x&amp;y&quot; : { string_value: &quot;hello&quot; }}}` would be represented by the field path `` foo.`x&amp;y` ``. A simple field name contains only characters `a` to `z`, `A` to `Z`, `0` to `9`, or `_`, and must not start with `0` to `9`. For example, `foo_bar_17`. A quoted field name starts and ends with `` ` `` and may contain any character. Some characters, including `` ` ``, must be escaped using a `\`. For example, `` `x&amp;y` `` represents `x&amp;y` and `` `bak\`tik` `` represents `` bak`tik ``.
1258 &quot;a_key&quot;: { # A message that can hold any of the supported value types.
1259 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
1260 &quot;values&quot;: [ # Values in the array.
1261 # Object with schema name: Value
1262 ],
1263 },
1264 &quot;booleanValue&quot;: True or False, # A boolean value.
1265 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
1266 &quot;doubleValue&quot;: 3.14, # A double value.
1267 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
1268 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
1269 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
1270 # Object with schema name: Value
1271 ],
1272 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1273 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1274 &quot;a_key&quot;: # Object with schema name: Value
1275 },
1276 },
1277 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
1278 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1279 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1280 },
1281 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
1282 &quot;mapValue&quot;: { # A map value. # A map value.
1283 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
1284 &quot;a_key&quot;: # Object with schema name: Value
1285 },
1286 },
1287 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
1288 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
1289 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
1290 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
1291 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
1292 # Object with schema name: Value
1293 ],
1294 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1295 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1296 &quot;a_key&quot;: # Object with schema name: Value
1297 },
1298 },
1299 ],
1300 },
1301 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1302 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
1303 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
1304 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
1305 },
1306 },
1307 &quot;name&quot;: &quot;A String&quot;, # The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1308 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was last changed. This value is initially set to the `create_time` then increases monotonically with each change to the document. It can also be compared to values from other documents and the `read_time` of a query.
1309 }
1310
1311 documentId: string, The client-assigned document ID to use for this document. Optional. If not specified, an ID will be assigned by the service.
1312 mask_fieldPaths: string, The list of field paths in the mask. See Document.fields for a field path syntax reference. (repeated)
1313 x__xgafv: string, V1 error format.
1314 Allowed values
1315 1 - v1 error format
1316 2 - v2 error format
1317
1318 Returns:
1319 An object of the form:
1320
1321 { # A Firestore document. Must not exceed 1 MiB - 4 bytes.
1322 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was created. This value increases monotonically when a document is deleted then recreated. It can also be compared to values from other documents and the `read_time` of a query.
1323 &quot;fields&quot;: { # The document&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The field names, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. Field paths may be used in other contexts to refer to structured fields defined here. For `map_value`, the field path is represented by a dot-delimited (`.`) string of segments. Each segment is either a simple field name (defined below) or a quoted field name. For example, the structured field `&quot;foo&quot; : { map_value: { &quot;x&amp;y&quot; : { string_value: &quot;hello&quot; }}}` would be represented by the field path `` foo.`x&amp;y` ``. A simple field name contains only characters `a` to `z`, `A` to `Z`, `0` to `9`, or `_`, and must not start with `0` to `9`. For example, `foo_bar_17`. A quoted field name starts and ends with `` ` `` and may contain any character. Some characters, including `` ` ``, must be escaped using a `\`. For example, `` `x&amp;y` `` represents `x&amp;y` and `` `bak\`tik` `` represents `` bak`tik ``.
1324 &quot;a_key&quot;: { # A message that can hold any of the supported value types.
1325 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
1326 &quot;values&quot;: [ # Values in the array.
1327 # Object with schema name: Value
1328 ],
1329 },
1330 &quot;booleanValue&quot;: True or False, # A boolean value.
1331 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
1332 &quot;doubleValue&quot;: 3.14, # A double value.
1333 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
1334 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
1335 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
1336 # Object with schema name: Value
1337 ],
1338 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1339 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1340 &quot;a_key&quot;: # Object with schema name: Value
1341 },
1342 },
1343 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
1344 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1345 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1346 },
1347 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
1348 &quot;mapValue&quot;: { # A map value. # A map value.
1349 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
1350 &quot;a_key&quot;: # Object with schema name: Value
1351 },
1352 },
1353 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
1354 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
1355 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
1356 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
1357 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
1358 # Object with schema name: Value
1359 ],
1360 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1361 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1362 &quot;a_key&quot;: # Object with schema name: Value
1363 },
1364 },
1365 ],
1366 },
1367 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1368 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
1369 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
1370 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
1371 },
1372 },
1373 &quot;name&quot;: &quot;A String&quot;, # The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1374 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was last changed. This value is initially set to the `create_time` then increases monotonically with each change to the document. It can also be compared to values from other documents and the `read_time` of a query.
1375 }</pre>
1376 </div>
1377
1378 <div class="method">
1379 <code class="details" id="delete">delete(name, currentDocument_exists=None, currentDocument_updateTime=None, x__xgafv=None)</code>
1380 <pre>Deletes a document.
1381
1382 Args:
1383 name: string, Required. The resource name of the Document to delete. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. (required)
1384 currentDocument_exists: boolean, When set to `true`, the target document must exist. When set to `false`, the target document must not exist.
1385 currentDocument_updateTime: string, When set, the target document must exist and have been last updated at that time. Timestamp must be microsecond aligned.
1386 x__xgafv: string, V1 error format.
1387 Allowed values
1388 1 - v1 error format
1389 2 - v2 error format
1390
1391 Returns:
1392 An object of the form:
1393
1394 { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
1395 }</pre>
1396 </div>
1397
1398 <div class="method">
1399 <code class="details" id="executePipeline">executePipeline(database, body=None, x__xgafv=None)</code>
1400 <pre>Executes a pipeline query.
1401
1402 Args:
1403 database: string, Required. Database identifier, in the form `projects/{project}/databases/{database}`. (required)
1404 body: object, The request body.
1405 The object takes the form of:
1406
1407 { # The request for Firestore.ExecutePipeline.
1408 &quot;autoCommitTransaction&quot;: True or False, # Optional. Automatically commits the transaction after the pipeline has been executed. Only permitted in combination with `transaction` or `new_transaction`.
1409 &quot;newTransaction&quot;: { # Options for creating a new transaction. # 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.
1410 &quot;readOnly&quot;: { # Options for a transaction that can only be used to read documents. # The transaction can only be used for read operations.
1411 &quot;readTime&quot;: &quot;A String&quot;, # Reads documents 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.
1412 },
1413 &quot;readWrite&quot;: { # Options for a transaction that can be used to read and write documents. # The transaction can be used for both read and write operations.
1414 &quot;concurrencyMode&quot;: &quot;A String&quot;, # Optional. The concurrency control mode to use for this transaction. A database is able to use different concurrency modes for different transactions simultaneously. 3rd party auth requests are only allowed to create optimistic read-write transactions and must specify that here even if the database-level setting is already configured to optimistic.
1415 &quot;retryTransaction&quot;: &quot;A String&quot;, # An optional transaction to retry.
1416 },
1417 },
1418 &quot;readTime&quot;: &quot;A String&quot;, # 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.
1419 &quot;structuredPipeline&quot;: { # 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. # A pipelined operation.
1420 &quot;options&quot;: { # Optional. Optional query-level arguments.
1421 &quot;a_key&quot;: { # A message that can hold any of the supported value types.
1422 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
1423 &quot;values&quot;: [ # Values in the array.
1424 # Object with schema name: Value
1425 ],
1426 },
1427 &quot;booleanValue&quot;: True or False, # A boolean value.
1428 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
1429 &quot;doubleValue&quot;: 3.14, # A double value.
1430 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
1431 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
1432 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
1433 # Object with schema name: Value
1434 ],
1435 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1436 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1437 &quot;a_key&quot;: # Object with schema name: Value
1438 },
1439 },
1440 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
1441 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1442 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1443 },
1444 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
1445 &quot;mapValue&quot;: { # A map value. # A map value.
1446 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
1447 &quot;a_key&quot;: # Object with schema name: Value
1448 },
1449 },
1450 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
1451 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
1452 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
1453 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
1454 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
1455 # Object with schema name: Value
1456 ],
1457 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1458 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1459 &quot;a_key&quot;: # Object with schema name: Value
1460 },
1461 },
1462 ],
1463 },
1464 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1465 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
1466 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
1467 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
1468 },
1469 },
1470 &quot;pipeline&quot;: { # A Firestore query represented as an ordered list of operations / stages. # Required. The pipeline query to execute.
1471 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
1472 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
1473 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
1474 # Object with schema name: Value
1475 ],
1476 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1477 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1478 &quot;a_key&quot;: # Object with schema name: Value
1479 },
1480 },
1481 ],
1482 },
1483 },
1484 &quot;transaction&quot;: &quot;A String&quot;, # Run the query within an already active transaction. The value here is the opaque transaction ID to execute the query in.
1485 }
1486
1487 x__xgafv: string, V1 error format.
1488 Allowed values
1489 1 - v1 error format
1490 2 - v2 error format
1491
1492 Returns:
1493 An object of the form:
1494
1495 { # The response for Firestore.Execute.
1496 &quot;executionTime&quot;: &quot;A String&quot;, # 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 `execution_time`. This allows the API consumer to treat the query if it ran at the latest `execution_time` returned. If the query returns no results, a response with `execution_time` and no `results` will be sent, and this represents the time at which the operation was run.
1497 &quot;explainStats&quot;: { # Pipeline explain stats. Depending on the explain options in the original request, this can contain the optimized plan and / or execution stats. # Query explain stats. This is present on the **last** response if the request configured explain to run in &#x27;analyze&#x27; or &#x27;explain&#x27; mode in the pipeline options. If the query does not return any results, a response with `explain_stats` and no `results` will still be sent.
1498 &quot;data&quot;: { # The format depends on the `output_format` options in the request. Currently there are two supported options: `TEXT` and `JSON`. Both supply a `google.protobuf.StringValue`.
1499 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1500 },
1501 },
1502 &quot;results&quot;: [ # 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 `__name__` and `__update_time__`. This is explicitly a divergence from `Firestore.RunQuery` / `Firestore.GetDocument` RPCs which always return such fields even when they are not specified in the `mask`.
1503 { # A Firestore document. Must not exceed 1 MiB - 4 bytes.
1504 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was created. This value increases monotonically when a document is deleted then recreated. It can also be compared to values from other documents and the `read_time` of a query.
1505 &quot;fields&quot;: { # The document&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The field names, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. Field paths may be used in other contexts to refer to structured fields defined here. For `map_value`, the field path is represented by a dot-delimited (`.`) string of segments. Each segment is either a simple field name (defined below) or a quoted field name. For example, the structured field `&quot;foo&quot; : { map_value: { &quot;x&amp;y&quot; : { string_value: &quot;hello&quot; }}}` would be represented by the field path `` foo.`x&amp;y` ``. A simple field name contains only characters `a` to `z`, `A` to `Z`, `0` to `9`, or `_`, and must not start with `0` to `9`. For example, `foo_bar_17`. A quoted field name starts and ends with `` ` `` and may contain any character. Some characters, including `` ` ``, must be escaped using a `\`. For example, `` `x&amp;y` `` represents `x&amp;y` and `` `bak\`tik` `` represents `` bak`tik ``.
1506 &quot;a_key&quot;: { # A message that can hold any of the supported value types.
1507 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
1508 &quot;values&quot;: [ # Values in the array.
1509 # Object with schema name: Value
1510 ],
1511 },
1512 &quot;booleanValue&quot;: True or False, # A boolean value.
1513 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
1514 &quot;doubleValue&quot;: 3.14, # A double value.
1515 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
1516 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
1517 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
1518 # Object with schema name: Value
1519 ],
1520 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1521 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1522 &quot;a_key&quot;: # Object with schema name: Value
1523 },
1524 },
1525 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
1526 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1527 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1528 },
1529 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
1530 &quot;mapValue&quot;: { # A map value. # A map value.
1531 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
1532 &quot;a_key&quot;: # Object with schema name: Value
1533 },
1534 },
1535 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
1536 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
1537 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
1538 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
1539 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
1540 # Object with schema name: Value
1541 ],
1542 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1543 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1544 &quot;a_key&quot;: # Object with schema name: Value
1545 },
1546 },
1547 ],
1548 },
1549 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1550 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
1551 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
1552 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
1553 },
1554 },
1555 &quot;name&quot;: &quot;A String&quot;, # The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1556 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was last changed. This value is initially set to the `create_time` then increases monotonically with each change to the document. It can also be compared to values from other documents and the `read_time` of a query.
1557 },
1558 ],
1559 &quot;transaction&quot;: &quot;A String&quot;, # Newly created transaction identifier. This field is only specified as part of the first response from the server, alongside the `results` field when the original request specified ExecuteRequest.new_transaction.
1560 }</pre>
1561 </div>
1562
1563 <div class="method">
1564 <code class="details" id="get">get(name, mask_fieldPaths=None, readTime=None, transaction=None, x__xgafv=None)</code>
1565 <pre>Gets a single document.
1566
1567 Args:
1568 name: string, Required. The resource name of the Document to get. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. (required)
1569 mask_fieldPaths: string, The list of field paths in the mask. See Document.fields for a field path syntax reference. (repeated)
1570 readTime: string, Reads the version of the document 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.
1571 transaction: string, Reads the document in a transaction.
1572 x__xgafv: string, V1 error format.
1573 Allowed values
1574 1 - v1 error format
1575 2 - v2 error format
1576
1577 Returns:
1578 An object of the form:
1579
1580 { # A Firestore document. Must not exceed 1 MiB - 4 bytes.
1581 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was created. This value increases monotonically when a document is deleted then recreated. It can also be compared to values from other documents and the `read_time` of a query.
1582 &quot;fields&quot;: { # The document&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The field names, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. Field paths may be used in other contexts to refer to structured fields defined here. For `map_value`, the field path is represented by a dot-delimited (`.`) string of segments. Each segment is either a simple field name (defined below) or a quoted field name. For example, the structured field `&quot;foo&quot; : { map_value: { &quot;x&amp;y&quot; : { string_value: &quot;hello&quot; }}}` would be represented by the field path `` foo.`x&amp;y` ``. A simple field name contains only characters `a` to `z`, `A` to `Z`, `0` to `9`, or `_`, and must not start with `0` to `9`. For example, `foo_bar_17`. A quoted field name starts and ends with `` ` `` and may contain any character. Some characters, including `` ` ``, must be escaped using a `\`. For example, `` `x&amp;y` `` represents `x&amp;y` and `` `bak\`tik` `` represents `` bak`tik ``.
1583 &quot;a_key&quot;: { # A message that can hold any of the supported value types.
1584 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
1585 &quot;values&quot;: [ # Values in the array.
1586 # Object with schema name: Value
1587 ],
1588 },
1589 &quot;booleanValue&quot;: True or False, # A boolean value.
1590 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
1591 &quot;doubleValue&quot;: 3.14, # A double value.
1592 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
1593 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
1594 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
1595 # Object with schema name: Value
1596 ],
1597 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1598 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1599 &quot;a_key&quot;: # Object with schema name: Value
1600 },
1601 },
1602 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
1603 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1604 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1605 },
1606 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
1607 &quot;mapValue&quot;: { # A map value. # A map value.
1608 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
1609 &quot;a_key&quot;: # Object with schema name: Value
1610 },
1611 },
1612 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
1613 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
1614 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
1615 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
1616 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
1617 # Object with schema name: Value
1618 ],
1619 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1620 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1621 &quot;a_key&quot;: # Object with schema name: Value
1622 },
1623 },
1624 ],
1625 },
1626 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1627 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
1628 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
1629 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
1630 },
1631 },
1632 &quot;name&quot;: &quot;A String&quot;, # The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1633 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was last changed. This value is initially set to the `create_time` then increases monotonically with each change to the document. It can also be compared to values from other documents and the `read_time` of a query.
1634 }</pre>
1635 </div>
1636
1637 <div class="method">
1638 <code class="details" id="list">list(parent, collectionId, mask_fieldPaths=None, orderBy=None, pageSize=None, pageToken=None, readTime=None, showMissing=None, transaction=None, x__xgafv=None)</code>
1639 <pre>Lists documents.
1640
1641 Args:
1642 parent: string, Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents` or `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` (required)
1643 collectionId: string, Optional. The collection ID, relative to `parent`, to list. For example: `chatrooms` or `messages`. This is optional, and when not provided, Firestore will list documents from all collections under the provided `parent`. (required)
1644 mask_fieldPaths: string, The list of field paths in the mask. See Document.fields for a field path syntax reference. (repeated)
1645 orderBy: string, Optional. The optional ordering of the documents to return. For example: `priority desc, __name__ desc`. This mirrors the `ORDER BY` used in Firestore queries but in a string representation. When absent, documents are ordered based on `__name__ ASC`.
1646 pageSize: integer, Optional. The maximum number of documents to return in a single response. Firestore may return fewer than this value.
1647 pageToken: string, Optional. A page token, received from a previous `ListDocuments` response. Provide this to retrieve the subsequent page. When paginating, all other parameters (with the exception of `page_size`) must match the values set in the request that generated the page token.
1648 readTime: string, Perform the read at the provided 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.
1649 showMissing: boolean, If the list should show missing documents. A document is missing if it does not exist, but there are sub-documents nested underneath it. When true, such missing documents will be returned with a key but will not have fields, `create_time`, or `update_time` set. Requests with `show_missing` may not specify `where` or `order_by`.
1650 transaction: string, Perform the read as part of an already active transaction.
1651 x__xgafv: string, V1 error format.
1652 Allowed values
1653 1 - v1 error format
1654 2 - v2 error format
1655
1656 Returns:
1657 An object of the form:
1658
1659 { # The response for Firestore.ListDocuments.
1660 &quot;documents&quot;: [ # The Documents found.
1661 { # A Firestore document. Must not exceed 1 MiB - 4 bytes.
1662 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was created. This value increases monotonically when a document is deleted then recreated. It can also be compared to values from other documents and the `read_time` of a query.
1663 &quot;fields&quot;: { # The document&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The field names, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. Field paths may be used in other contexts to refer to structured fields defined here. For `map_value`, the field path is represented by a dot-delimited (`.`) string of segments. Each segment is either a simple field name (defined below) or a quoted field name. For example, the structured field `&quot;foo&quot; : { map_value: { &quot;x&amp;y&quot; : { string_value: &quot;hello&quot; }}}` would be represented by the field path `` foo.`x&amp;y` ``. A simple field name contains only characters `a` to `z`, `A` to `Z`, `0` to `9`, or `_`, and must not start with `0` to `9`. For example, `foo_bar_17`. A quoted field name starts and ends with `` ` `` and may contain any character. Some characters, including `` ` ``, must be escaped using a `\`. For example, `` `x&amp;y` `` represents `x&amp;y` and `` `bak\`tik` `` represents `` bak`tik ``.
1664 &quot;a_key&quot;: { # A message that can hold any of the supported value types.
1665 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
1666 &quot;values&quot;: [ # Values in the array.
1667 # Object with schema name: Value
1668 ],
1669 },
1670 &quot;booleanValue&quot;: True or False, # A boolean value.
1671 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
1672 &quot;doubleValue&quot;: 3.14, # A double value.
1673 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
1674 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
1675 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
1676 # Object with schema name: Value
1677 ],
1678 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1679 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1680 &quot;a_key&quot;: # Object with schema name: Value
1681 },
1682 },
1683 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
1684 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1685 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1686 },
1687 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
1688 &quot;mapValue&quot;: { # A map value. # A map value.
1689 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
1690 &quot;a_key&quot;: # Object with schema name: Value
1691 },
1692 },
1693 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
1694 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
1695 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
1696 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
1697 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
1698 # Object with schema name: Value
1699 ],
1700 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1701 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1702 &quot;a_key&quot;: # Object with schema name: Value
1703 },
1704 },
1705 ],
1706 },
1707 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1708 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
1709 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
1710 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
1711 },
1712 },
1713 &quot;name&quot;: &quot;A String&quot;, # The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1714 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was last changed. This value is initially set to the `create_time` then increases monotonically with each change to the document. It can also be compared to values from other documents and the `read_time` of a query.
1715 },
1716 ],
1717 &quot;nextPageToken&quot;: &quot;A String&quot;, # A token to retrieve the next page of documents. If this field is omitted, there are no subsequent pages.
1718 }</pre>
1719 </div>
1720
1721 <div class="method">
1722 <code class="details" id="listCollectionIds">listCollectionIds(parent, body=None, x__xgafv=None)</code>
1723 <pre>Lists all the collection IDs underneath a document.
1724
1725 Args:
1726 parent: string, Required. The parent document. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` Use `projects/{project_id}/databases/{database_id}/documents` to list top-level collections. (required)
1727 body: object, The request body.
1728 The object takes the form of:
1729
1730 { # The request for Firestore.ListCollectionIds.
1731 &quot;pageSize&quot;: 42, # The maximum number of results to return.
1732 &quot;pageToken&quot;: &quot;A String&quot;, # A page token. Must be a value from ListCollectionIdsResponse.
1733 &quot;readTime&quot;: &quot;A String&quot;, # Reads documents as they were 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.
1734 }
1735
1736 x__xgafv: string, V1 error format.
1737 Allowed values
1738 1 - v1 error format
1739 2 - v2 error format
1740
1741 Returns:
1742 An object of the form:
1743
1744 { # The response from Firestore.ListCollectionIds.
1745 &quot;collectionIds&quot;: [ # The collection ids.
1746 &quot;A String&quot;,
1747 ],
1748 &quot;nextPageToken&quot;: &quot;A String&quot;, # A page token that may be used to continue the list.
1749 }</pre>
1750 </div>
1751
1752 <div class="method">
1753 <code class="details" id="listCollectionIds_next">listCollectionIds_next()</code>
1754 <pre>Retrieves the next page of results.
1755
1756 Args:
1757 previous_request: The request for the previous page. (required)
1758 previous_response: The response from the request for the previous page. (required)
1759
1760 Returns:
1761 A request object that you can call &#x27;execute()&#x27; on to request the next
1762 page. Returns None if there are no more items in the collection.
1763 </pre>
1764 </div>
1765
1766 <div class="method">
1767 <code class="details" id="listDocuments">listDocuments(parent, collectionId, mask_fieldPaths=None, orderBy=None, pageSize=None, pageToken=None, readTime=None, showMissing=None, transaction=None, x__xgafv=None)</code>
1768 <pre>Lists documents.
1769
1770 Args:
1771 parent: string, Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents` or `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` (required)
1772 collectionId: string, Optional. The collection ID, relative to `parent`, to list. For example: `chatrooms` or `messages`. This is optional, and when not provided, Firestore will list documents from all collections under the provided `parent`. (required)
1773 mask_fieldPaths: string, The list of field paths in the mask. See Document.fields for a field path syntax reference. (repeated)
1774 orderBy: string, Optional. The optional ordering of the documents to return. For example: `priority desc, __name__ desc`. This mirrors the `ORDER BY` used in Firestore queries but in a string representation. When absent, documents are ordered based on `__name__ ASC`.
1775 pageSize: integer, Optional. The maximum number of documents to return in a single response. Firestore may return fewer than this value.
1776 pageToken: string, Optional. A page token, received from a previous `ListDocuments` response. Provide this to retrieve the subsequent page. When paginating, all other parameters (with the exception of `page_size`) must match the values set in the request that generated the page token.
1777 readTime: string, Perform the read at the provided 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.
1778 showMissing: boolean, If the list should show missing documents. A document is missing if it does not exist, but there are sub-documents nested underneath it. When true, such missing documents will be returned with a key but will not have fields, `create_time`, or `update_time` set. Requests with `show_missing` may not specify `where` or `order_by`.
1779 transaction: string, Perform the read as part of an already active transaction.
1780 x__xgafv: string, V1 error format.
1781 Allowed values
1782 1 - v1 error format
1783 2 - v2 error format
1784
1785 Returns:
1786 An object of the form:
1787
1788 { # The response for Firestore.ListDocuments.
1789 &quot;documents&quot;: [ # The Documents found.
1790 { # A Firestore document. Must not exceed 1 MiB - 4 bytes.
1791 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was created. This value increases monotonically when a document is deleted then recreated. It can also be compared to values from other documents and the `read_time` of a query.
1792 &quot;fields&quot;: { # The document&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The field names, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. Field paths may be used in other contexts to refer to structured fields defined here. For `map_value`, the field path is represented by a dot-delimited (`.`) string of segments. Each segment is either a simple field name (defined below) or a quoted field name. For example, the structured field `&quot;foo&quot; : { map_value: { &quot;x&amp;y&quot; : { string_value: &quot;hello&quot; }}}` would be represented by the field path `` foo.`x&amp;y` ``. A simple field name contains only characters `a` to `z`, `A` to `Z`, `0` to `9`, or `_`, and must not start with `0` to `9`. For example, `foo_bar_17`. A quoted field name starts and ends with `` ` `` and may contain any character. Some characters, including `` ` ``, must be escaped using a `\`. For example, `` `x&amp;y` `` represents `x&amp;y` and `` `bak\`tik` `` represents `` bak`tik ``.
1793 &quot;a_key&quot;: { # A message that can hold any of the supported value types.
1794 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
1795 &quot;values&quot;: [ # Values in the array.
1796 # Object with schema name: Value
1797 ],
1798 },
1799 &quot;booleanValue&quot;: True or False, # A boolean value.
1800 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
1801 &quot;doubleValue&quot;: 3.14, # A double value.
1802 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
1803 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
1804 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
1805 # Object with schema name: Value
1806 ],
1807 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1808 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1809 &quot;a_key&quot;: # Object with schema name: Value
1810 },
1811 },
1812 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
1813 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1814 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1815 },
1816 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
1817 &quot;mapValue&quot;: { # A map value. # A map value.
1818 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
1819 &quot;a_key&quot;: # Object with schema name: Value
1820 },
1821 },
1822 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
1823 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
1824 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
1825 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
1826 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
1827 # Object with schema name: Value
1828 ],
1829 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1830 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1831 &quot;a_key&quot;: # Object with schema name: Value
1832 },
1833 },
1834 ],
1835 },
1836 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1837 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
1838 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
1839 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
1840 },
1841 },
1842 &quot;name&quot;: &quot;A String&quot;, # The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1843 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was last changed. This value is initially set to the `create_time` then increases monotonically with each change to the document. It can also be compared to values from other documents and the `read_time` of a query.
1844 },
1845 ],
1846 &quot;nextPageToken&quot;: &quot;A String&quot;, # A token to retrieve the next page of documents. If this field is omitted, there are no subsequent pages.
1847 }</pre>
1848 </div>
1849
1850 <div class="method">
1851 <code class="details" id="listDocuments_next">listDocuments_next()</code>
1852 <pre>Retrieves the next page of results.
1853
1854 Args:
1855 previous_request: The request for the previous page. (required)
1856 previous_response: The response from the request for the previous page. (required)
1857
1858 Returns:
1859 A request object that you can call &#x27;execute()&#x27; on to request the next
1860 page. Returns None if there are no more items in the collection.
1861 </pre>
1862 </div>
1863
1864 <div class="method">
1865 <code class="details" id="list_next">list_next()</code>
1866 <pre>Retrieves the next page of results.
1867
1868 Args:
1869 previous_request: The request for the previous page. (required)
1870 previous_response: The response from the request for the previous page. (required)
1871
1872 Returns:
1873 A request object that you can call &#x27;execute()&#x27; on to request the next
1874 page. Returns None if there are no more items in the collection.
1875 </pre>
1876 </div>
1877
1878 <div class="method">
1879 <code class="details" id="listen">listen(database, body=None, x__xgafv=None)</code>
1880 <pre>Listens to changes. This method is only available via gRPC or WebChannel (not REST).
1881
1882 Args:
1883 database: string, Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. (required)
1884 body: object, The request body.
1885 The object takes the form of:
1886
1887 { # A request for Firestore.Listen
1888 &quot;addTarget&quot;: { # A specification of a set of documents to listen to. # A target to add to this stream.
1889 &quot;documents&quot;: { # A target specified by a set of documents names. # A target specified by a set of document names.
1890 &quot;documents&quot;: [ # The names of the documents to retrieve. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. The request will fail if any of the document is not a child resource of the given `database`. Duplicate names will be elided.
1891 &quot;A String&quot;,
1892 ],
1893 },
1894 &quot;expectedCount&quot;: 42, # The number of documents that last matched the query at the resume token or read time. This value is only relevant when a `resume_type` is provided. This value being present and greater than zero signals that the client wants `ExistenceFilter.unchanged_names` to be included in the response.
1895 &quot;once&quot;: True or False, # If the target should be removed once it is current and consistent.
1896 &quot;query&quot;: { # A target specified by a query. # A target specified by a query.
1897 &quot;parent&quot;: &quot;A String&quot;, # The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents` or `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
1898 &quot;structuredQuery&quot;: { # A Firestore query. The query stages are executed in the following order: 1. from 2. where 3. select 4. order_by + start_at + end_at 5. offset 6. limit 7. find_nearest # A structured query.
1899 &quot;endAt&quot;: { # A position in a query result set. # A potential prefix of a position in the result set to end the query at. This is similar to `START_AT` but with it controlling the end position rather than the start position. Requires: * The number of values cannot be greater than the number of fields specified in the `ORDER BY` clause.
1900 &quot;before&quot;: True or False, # If the position is just before or just after the given values, relative to the sort order defined by the query.
1901 &quot;values&quot;: [ # The values that represent a position, in the order they appear in the order by clause of a query. Can contain fewer values than specified in the order by clause.
1902 { # A message that can hold any of the supported value types.
1903 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
1904 &quot;values&quot;: [ # Values in the array.
1905 # Object with schema name: Value
1906 ],
1907 },
1908 &quot;booleanValue&quot;: True or False, # A boolean value.
1909 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
1910 &quot;doubleValue&quot;: 3.14, # A double value.
1911 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
1912 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
1913 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
1914 # Object with schema name: Value
1915 ],
1916 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1917 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1918 &quot;a_key&quot;: # Object with schema name: Value
1919 },
1920 },
1921 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
1922 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1923 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1924 },
1925 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
1926 &quot;mapValue&quot;: { # A map value. # A map value.
1927 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
1928 &quot;a_key&quot;: # Object with schema name: Value
1929 },
1930 },
1931 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
1932 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
1933 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
1934 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
1935 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
1936 # Object with schema name: Value
1937 ],
1938 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1939 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1940 &quot;a_key&quot;: # Object with schema name: Value
1941 },
1942 },
1943 ],
1944 },
1945 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
1946 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
1947 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
1948 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
1949 },
1950 ],
1951 },
1952 &quot;findNearest&quot;: { # Nearest Neighbors search config. The ordering provided by FindNearest supersedes the order_by stage. If multiple documents have the same vector distance, the returned document order is not guaranteed to be stable between queries. # Optional. A potential nearest neighbors search. Applies after all other filters and ordering. Finds the closest vector embeddings to the given query vector.
1953 &quot;distanceMeasure&quot;: &quot;A String&quot;, # Required. The distance measure to use, required.
1954 &quot;distanceResultField&quot;: &quot;A String&quot;, # Optional. Optional name of the field to output the result of the vector distance calculation. Must conform to document field name limitations.
1955 &quot;distanceThreshold&quot;: 3.14, # Optional. Option to specify a threshold for which no less similar documents will be returned. The behavior of the specified `distance_measure` will affect the meaning of the distance threshold. Since DOT_PRODUCT distances increase when the vectors are more similar, the comparison is inverted. * For EUCLIDEAN, COSINE: `WHERE distance &lt;= distance_threshold` * For DOT_PRODUCT: `WHERE distance &gt;= distance_threshold`
1956 &quot;limit&quot;: 42, # Required. The number of nearest neighbors to return. Must be a positive integer of no more than 1000.
1957 &quot;queryVector&quot;: { # A message that can hold any of the supported value types. # Required. The query vector that we are searching on. Must be a vector of no more than 2048 dimensions.
1958 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
1959 &quot;values&quot;: [ # Values in the array.
1960 # Object with schema name: Value
1961 ],
1962 },
1963 &quot;booleanValue&quot;: True or False, # A boolean value.
1964 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
1965 &quot;doubleValue&quot;: 3.14, # A double value.
1966 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
1967 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
1968 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
1969 # Object with schema name: Value
1970 ],
1971 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1972 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1973 &quot;a_key&quot;: # Object with schema name: Value
1974 },
1975 },
1976 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
1977 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
1978 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
1979 },
1980 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
1981 &quot;mapValue&quot;: { # A map value. # A map value.
1982 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
1983 &quot;a_key&quot;: # Object with schema name: Value
1984 },
1985 },
1986 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
1987 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
1988 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
1989 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
1990 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
1991 # Object with schema name: Value
1992 ],
1993 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
1994 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
1995 &quot;a_key&quot;: # Object with schema name: Value
1996 },
1997 },
1998 ],
1999 },
2000 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
2001 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
2002 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
2003 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
2004 },
2005 &quot;vectorField&quot;: { # A reference to a field in a document, ex: `stats.operations`. # Required. An indexed vector field to search upon. Only documents which contain vectors whose dimensionality match the query_vector can be returned.
2006 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
2007 },
2008 },
2009 &quot;from&quot;: [ # The collections to query.
2010 { # A selection of a collection, such as `messages as m1`.
2011 &quot;allDescendants&quot;: True or False, # When false, selects only collections that are immediate children of the `parent` specified in the containing `RunQueryRequest`. When true, selects all descendant collections.
2012 &quot;collectionId&quot;: &quot;A String&quot;, # The collection ID. When set, selects only collections with this ID.
2013 },
2014 ],
2015 &quot;limit&quot;: 42, # The maximum number of results to return. Applies after all other constraints. Requires: * The value must be greater than or equal to zero if specified.
2016 &quot;offset&quot;: 42, # The number of documents to skip before returning the first result. This applies after the constraints specified by the `WHERE`, `START AT`, &amp; `END AT` but before the `LIMIT` clause. Requires: * The value must be greater than or equal to zero if specified.
2017 &quot;orderBy&quot;: [ # The order to apply to the query results. Callers can provide a full ordering, a partial ordering, or no ordering at all. While Firestore will always respect the provided order, the behavior for queries without a full ordering is different per database edition: In Standard edition, Firestore guarantees a stable ordering through the following rules: * The `order_by` is required to reference all fields used with an inequality filter. * All fields that are required to be in the `order_by` but are not already present are appended in lexicographical ordering of the field name. * If an order on `__name__` is not specified, it is appended by default. Fields are appended with the same sort direction as the last order specified, or &#x27;ASCENDING&#x27; if no order was specified. For example: * `ORDER BY a` becomes `ORDER BY a ASC, __name__ ASC` * `ORDER BY a DESC` becomes `ORDER BY a DESC, __name__ DESC` * `WHERE a &gt; 1` becomes `WHERE a &gt; 1 ORDER BY a ASC, __name__ ASC` * `WHERE __name__ &gt; ... AND a &gt; 1` becomes `WHERE __name__ &gt; ... AND a &gt; 1 ORDER BY a ASC, __name__ ASC` In Enterprise edition, Firestore does not guarantee a stable ordering. Instead it will pick the most efficient ordering based on the indexes available at the time of query execution. This will result in a different ordering for queries that are otherwise identical. To ensure a stable ordering, always include a unique field in the `order_by` clause, such as `__name__`.
2018 { # An order on a field.
2019 &quot;direction&quot;: &quot;A String&quot;, # The direction to order by. Defaults to `ASCENDING`.
2020 &quot;field&quot;: { # A reference to a field in a document, ex: `stats.operations`. # The field to order by.
2021 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
2022 },
2023 },
2024 ],
2025 &quot;select&quot;: { # The projection of document&#x27;s fields to return. # Optional sub-set of the fields to return. This acts as a DocumentMask over the documents returned from a query. When not set, assumes that the caller wants all fields returned.
2026 &quot;fields&quot;: [ # The fields to return. If empty, all fields are returned. To only return the name of the document, use `[&#x27;__name__&#x27;]`.
2027 { # A reference to a field in a document, ex: `stats.operations`.
2028 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
2029 },
2030 ],
2031 },
2032 &quot;startAt&quot;: { # A position in a query result set. # A potential prefix of a position in the result set to start the query at. The ordering of the result set is based on the `ORDER BY` clause of the original query. ``` SELECT * FROM k WHERE a = 1 AND b &gt; 2 ORDER BY b ASC, __name__ ASC; ``` This query&#x27;s results are ordered by `(b ASC, __name__ ASC)`. Cursors can reference either the full ordering or a prefix of the location, though it cannot reference more fields than what are in the provided `ORDER BY`. Continuing off the example above, attaching the following start cursors will have varying impact: - `START BEFORE (2, /k/123)`: start the query right before `a = 1 AND b &gt; 2 AND __name__ &gt; /k/123`. - `START AFTER (10)`: start the query right after `a = 1 AND b &gt; 10`. Unlike `OFFSET` which requires scanning over the first N results to skip, a start cursor allows the query to begin at a logical position. This position is not required to match an actual result, it will scan forward from this position to find the next document. Requires: * The number of values cannot be greater than the number of fields specified in the `ORDER BY` clause.
2033 &quot;before&quot;: True or False, # If the position is just before or just after the given values, relative to the sort order defined by the query.
2034 &quot;values&quot;: [ # The values that represent a position, in the order they appear in the order by clause of a query. Can contain fewer values than specified in the order by clause.
2035 { # A message that can hold any of the supported value types.
2036 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
2037 &quot;values&quot;: [ # Values in the array.
2038 # Object with schema name: Value
2039 ],
2040 },
2041 &quot;booleanValue&quot;: True or False, # A boolean value.
2042 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
2043 &quot;doubleValue&quot;: 3.14, # A double value.
2044 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
2045 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
2046 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
2047 # Object with schema name: Value
2048 ],
2049 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2050 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2051 &quot;a_key&quot;: # Object with schema name: Value
2052 },
2053 },
2054 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
2055 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
2056 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
2057 },
2058 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
2059 &quot;mapValue&quot;: { # A map value. # A map value.
2060 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
2061 &quot;a_key&quot;: # Object with schema name: Value
2062 },
2063 },
2064 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
2065 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
2066 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
2067 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
2068 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
2069 # Object with schema name: Value
2070 ],
2071 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2072 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2073 &quot;a_key&quot;: # Object with schema name: Value
2074 },
2075 },
2076 ],
2077 },
2078 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
2079 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
2080 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
2081 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
2082 },
2083 ],
2084 },
2085 &quot;where&quot;: { # A filter. # The filter to apply.
2086 &quot;compositeFilter&quot;: { # A filter that merges multiple other filters using the given operator. # A composite filter.
2087 &quot;filters&quot;: [ # The list of filters to combine. Requires: * At least one filter is present.
2088 # Object with schema name: Filter
2089 ],
2090 &quot;op&quot;: &quot;A String&quot;, # The operator for combining multiple filters.
2091 },
2092 &quot;fieldFilter&quot;: { # A filter on a specific field. # A filter on a document field.
2093 &quot;field&quot;: { # A reference to a field in a document, ex: `stats.operations`. # The field to filter by.
2094 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
2095 },
2096 &quot;op&quot;: &quot;A String&quot;, # The operator to filter by.
2097 &quot;value&quot;: { # A message that can hold any of the supported value types. # The value to compare to.
2098 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
2099 &quot;values&quot;: [ # Values in the array.
2100 # Object with schema name: Value
2101 ],
2102 },
2103 &quot;booleanValue&quot;: True or False, # A boolean value.
2104 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
2105 &quot;doubleValue&quot;: 3.14, # A double value.
2106 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
2107 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
2108 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
2109 # Object with schema name: Value
2110 ],
2111 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2112 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2113 &quot;a_key&quot;: # Object with schema name: Value
2114 },
2115 },
2116 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
2117 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
2118 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
2119 },
2120 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
2121 &quot;mapValue&quot;: { # A map value. # A map value.
2122 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
2123 &quot;a_key&quot;: # Object with schema name: Value
2124 },
2125 },
2126 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
2127 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
2128 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
2129 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
2130 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
2131 # Object with schema name: Value
2132 ],
2133 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2134 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2135 &quot;a_key&quot;: # Object with schema name: Value
2136 },
2137 },
2138 ],
2139 },
2140 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
2141 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
2142 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
2143 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
2144 },
2145 },
2146 &quot;unaryFilter&quot;: { # A filter with a single operand. # A filter that takes exactly one argument.
2147 &quot;field&quot;: { # A reference to a field in a document, ex: `stats.operations`. # The field to which to apply the operator.
2148 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
2149 },
2150 &quot;op&quot;: &quot;A String&quot;, # The unary operator to apply.
2151 },
2152 },
2153 },
2154 },
2155 &quot;readTime&quot;: &quot;A String&quot;, # Start listening after a specific `read_time`. The client must know the state of matching documents at this time.
2156 &quot;resumeToken&quot;: &quot;A String&quot;, # A resume token from a prior TargetChange for an identical target. Using a resume token with a different target is unsupported and may fail.
2157 &quot;targetId&quot;: 42, # The target ID that identifies the target on the stream. Must be a positive number and non-zero. If `target_id` is 0 (or unspecified), the server will assign an ID for this target and return that in a `TargetChange::ADD` event. Once a target with `target_id=0` is added, all subsequent targets must also have `target_id=0`. If an `AddTarget` request with `target_id != 0` is sent to the server after a target with `target_id=0` is added, the server will immediately send a response with a `TargetChange::Remove` event. Note that if the client sends multiple `AddTarget` requests without an ID, the order of IDs returned in `TargetChange.target_ids` are undefined. Therefore, clients should provide a target ID instead of relying on the server to assign one. If `target_id` is non-zero, there must not be an existing active target on this stream with the same ID.
2158 },
2159 &quot;labels&quot;: { # Labels associated with this target change.
2160 &quot;a_key&quot;: &quot;A String&quot;,
2161 },
2162 &quot;removeTarget&quot;: 42, # The ID of a target to remove from this stream.
2163 }
2164
2165 x__xgafv: string, V1 error format.
2166 Allowed values
2167 1 - v1 error format
2168 2 - v2 error format
2169
2170 Returns:
2171 An object of the form:
2172
2173 { # The response for Firestore.Listen.
2174 &quot;documentChange&quot;: { # A Document has changed. May be the result of multiple writes, including deletes, that ultimately resulted in a new value for the Document. Multiple DocumentChange messages may be returned for the same logical change, if multiple targets are affected. # A Document has changed.
2175 &quot;document&quot;: { # A Firestore document. Must not exceed 1 MiB - 4 bytes. # The new state of the Document. If `mask` is set, contains only fields that were updated or added.
2176 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was created. This value increases monotonically when a document is deleted then recreated. It can also be compared to values from other documents and the `read_time` of a query.
2177 &quot;fields&quot;: { # The document&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The field names, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. Field paths may be used in other contexts to refer to structured fields defined here. For `map_value`, the field path is represented by a dot-delimited (`.`) string of segments. Each segment is either a simple field name (defined below) or a quoted field name. For example, the structured field `&quot;foo&quot; : { map_value: { &quot;x&amp;y&quot; : { string_value: &quot;hello&quot; }}}` would be represented by the field path `` foo.`x&amp;y` ``. A simple field name contains only characters `a` to `z`, `A` to `Z`, `0` to `9`, or `_`, and must not start with `0` to `9`. For example, `foo_bar_17`. A quoted field name starts and ends with `` ` `` and may contain any character. Some characters, including `` ` ``, must be escaped using a `\`. For example, `` `x&amp;y` `` represents `x&amp;y` and `` `bak\`tik` `` represents `` bak`tik ``.
2178 &quot;a_key&quot;: { # A message that can hold any of the supported value types.
2179 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
2180 &quot;values&quot;: [ # Values in the array.
2181 # Object with schema name: Value
2182 ],
2183 },
2184 &quot;booleanValue&quot;: True or False, # A boolean value.
2185 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
2186 &quot;doubleValue&quot;: 3.14, # A double value.
2187 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
2188 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
2189 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
2190 # Object with schema name: Value
2191 ],
2192 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2193 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2194 &quot;a_key&quot;: # Object with schema name: Value
2195 },
2196 },
2197 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
2198 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
2199 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
2200 },
2201 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
2202 &quot;mapValue&quot;: { # A map value. # A map value.
2203 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
2204 &quot;a_key&quot;: # Object with schema name: Value
2205 },
2206 },
2207 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
2208 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
2209 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
2210 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
2211 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
2212 # Object with schema name: Value
2213 ],
2214 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2215 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2216 &quot;a_key&quot;: # Object with schema name: Value
2217 },
2218 },
2219 ],
2220 },
2221 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
2222 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
2223 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
2224 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
2225 },
2226 },
2227 &quot;name&quot;: &quot;A String&quot;, # The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
2228 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was last changed. This value is initially set to the `create_time` then increases monotonically with each change to the document. It can also be compared to values from other documents and the `read_time` of a query.
2229 },
2230 &quot;removedTargetIds&quot;: [ # A set of target IDs for targets that no longer match this document.
2231 42,
2232 ],
2233 &quot;targetIds&quot;: [ # A set of target IDs of targets that match this document.
2234 42,
2235 ],
2236 },
2237 &quot;documentDelete&quot;: { # A Document has been deleted. May be the result of multiple writes, including updates, the last of which deleted the Document. Multiple DocumentDelete messages may be returned for the same logical delete, if multiple targets are affected. # A Document has been deleted.
2238 &quot;document&quot;: &quot;A String&quot;, # The resource name of the Document that was deleted.
2239 &quot;readTime&quot;: &quot;A String&quot;, # The read timestamp at which the delete was observed. Greater or equal to the `commit_time` of the delete.
2240 &quot;removedTargetIds&quot;: [ # A set of target IDs for targets that previously matched this entity.
2241 42,
2242 ],
2243 },
2244 &quot;documentRemove&quot;: { # A Document has been removed from the view of the targets. Sent if the document is no longer relevant to a target and is out of view. Can be sent instead of a DocumentDelete or a DocumentChange if the server can not send the new value of the document. Multiple DocumentRemove messages may be returned for the same logical write or delete, if multiple targets are affected. # A Document has been removed from a target (because it is no longer relevant to that target).
2245 &quot;document&quot;: &quot;A String&quot;, # The resource name of the Document that has gone out of view.
2246 &quot;readTime&quot;: &quot;A String&quot;, # The read timestamp at which the remove was observed. Greater or equal to the `commit_time` of the change/delete/remove.
2247 &quot;removedTargetIds&quot;: [ # A set of target IDs for targets that previously matched this document.
2248 42,
2249 ],
2250 },
2251 &quot;filter&quot;: { # A digest of all the documents that match a given target. # A filter to apply to the set of documents previously returned for the given target. Returned when documents may have been removed from the given target, but the exact documents are unknown.
2252 &quot;count&quot;: 42, # The total count of documents that match target_id. If different from the count of documents in the client that match, the client must manually determine which documents no longer match the target. The client can use the `unchanged_names` bloom filter to assist with this determination by testing ALL the document names against the filter; if the document name is NOT in the filter, it means the document no longer matches the target.
2253 &quot;targetId&quot;: 42, # The target ID to which this filter applies.
2254 &quot;unchangedNames&quot;: { # A bloom filter (https://en.wikipedia.org/wiki/Bloom_filter). The bloom filter hashes the entries with MD5 and treats the resulting 128-bit hash as 2 distinct 64-bit hash values, interpreted as unsigned integers using 2&#x27;s complement encoding. These two hash values, named `h1` and `h2`, are then used to compute the `hash_count` hash values using the formula, starting at `i=0`: h(i) = h1 + (i * h2) These resulting values are then taken modulo the number of bits in the bloom filter to get the bits of the bloom filter to test for the given entry. # A bloom filter that, despite its name, contains the UTF-8 byte encodings of the resource names of ALL the documents that match target_id, in the form `projects/{project_id}/databases/{database_id}/documents/{document_path}`. This bloom filter may be omitted at the server&#x27;s discretion, such as if it is deemed that the client will not make use of it or if it is too computationally expensive to calculate or transmit. Clients must gracefully handle this field being absent by falling back to the logic used before this field existed; that is, re-add the target without a resume token to figure out which documents in the client&#x27;s cache are out of sync.
2255 &quot;bits&quot;: { # A sequence of bits, encoded in a byte array. Each byte in the `bitmap` byte array stores 8 bits of the sequence. The only exception is the last byte, which may store 8 _or fewer_ bits. The `padding` defines the number of bits of the last byte to be ignored as &quot;padding&quot;. The values of these &quot;padding&quot; bits are unspecified and must be ignored. To retrieve the first bit, bit 0, calculate: `(bitmap[0] &amp; 0x01) != 0`. To retrieve the second bit, bit 1, calculate: `(bitmap[0] &amp; 0x02) != 0`. To retrieve the third bit, bit 2, calculate: `(bitmap[0] &amp; 0x04) != 0`. To retrieve the fourth bit, bit 3, calculate: `(bitmap[0] &amp; 0x08) != 0`. To retrieve bit n, calculate: `(bitmap[n / 8] &amp; (0x01 &lt;&lt; (n % 8))) != 0`. The &quot;size&quot; of a `BitSequence` (the number of bits it contains) is calculated by this formula: `(bitmap.length * 8) - padding`. # The bloom filter data.
2256 &quot;bitmap&quot;: &quot;A String&quot;, # The bytes that encode the bit sequence. May have a length of zero.
2257 &quot;padding&quot;: 42, # The number of bits of the last byte in `bitmap` to ignore as &quot;padding&quot;. If the length of `bitmap` is zero, then this value must be `0`. Otherwise, this value must be between 0 and 7, inclusive.
2258 },
2259 &quot;hashCount&quot;: 42, # The number of hashes used by the algorithm.
2260 },
2261 },
2262 &quot;targetChange&quot;: { # Targets being watched have changed. # Targets have changed.
2263 &quot;cause&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error that resulted in this change, if applicable.
2264 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
2265 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
2266 {
2267 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
2268 },
2269 ],
2270 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
2271 },
2272 &quot;readTime&quot;: &quot;A String&quot;, # The consistent `read_time` for the given `target_ids` (omitted when the target_ids are not at a consistent snapshot). The stream is guaranteed to send a `read_time` with `target_ids` empty whenever the entire stream reaches a new consistent snapshot. ADD, CURRENT, and RESET messages are guaranteed to (eventually) result in a new consistent snapshot (while NO_CHANGE and REMOVE messages are not). For a given stream, `read_time` is guaranteed to be monotonically increasing.
2273 &quot;resumeToken&quot;: &quot;A String&quot;, # A token that can be used to resume the stream for the given `target_ids`, or all targets if `target_ids` is empty. Not set on every target change.
2274 &quot;targetChangeType&quot;: &quot;A String&quot;, # The type of change that occurred.
2275 &quot;targetIds&quot;: [ # The target IDs of targets that have changed. If empty, the change applies to all targets. The order of the target IDs is not defined.
2276 42,
2277 ],
2278 },
2279 }</pre>
2280 </div>
2281
2282 <div class="method">
2283 <code class="details" id="partitionQuery">partitionQuery(parent, body=None, x__xgafv=None)</code>
2284 <pre>Partitions a query by returning partition cursors that can be used to run the query in parallel. The returned partition cursors are split points that can be used by RunQuery as starting/end points for the query results.
2285
2286 Args:
2287 parent: string, Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents`. Document resource names are not supported; only database resource names can be specified. (required)
2288 body: object, The request body.
2289 The object takes the form of:
2290
2291 { # The request for Firestore.PartitionQuery.
2292 &quot;pageSize&quot;: 42, # The maximum number of partitions to return in this call, subject to `partition_count`. For example, if `partition_count` = 10 and `page_size` = 8, the first call to PartitionQuery will return up to 8 partitions and a `next_page_token` if more results exist. A second call to PartitionQuery will return up to 2 partitions, to complete the total of 10 specified in `partition_count`.
2293 &quot;pageToken&quot;: &quot;A String&quot;, # The `next_page_token` value returned from a previous call to PartitionQuery that may be used to get an additional set of results. There are no ordering guarantees between sets of results. Thus, using multiple sets of results will require merging the different result sets. For example, two subsequent calls using a page_token may return: * cursor B, cursor M, cursor Q * cursor A, cursor U, cursor W To obtain a complete result set ordered with respect to the results of the query supplied to PartitionQuery, the results sets should be merged: cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W
2294 &quot;partitionCount&quot;: &quot;A String&quot;, # The desired maximum number of partition points. The partitions may be returned across multiple pages of results. The number must be positive. The actual number of partitions returned may be fewer. For example, this may be set to one fewer than the number of parallel queries to be run, or in running a data pipeline job, one fewer than the number of workers or compute instances available.
2295 &quot;readTime&quot;: &quot;A String&quot;, # Reads documents as they were 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.
2296 &quot;structuredQuery&quot;: { # A Firestore query. The query stages are executed in the following order: 1. from 2. where 3. select 4. order_by + start_at + end_at 5. offset 6. limit 7. find_nearest # A structured query. Query must specify collection with all descendants and be ordered by name ascending. Other filters, order bys, limits, offsets, and start/end cursors are not supported.
2297 &quot;endAt&quot;: { # A position in a query result set. # A potential prefix of a position in the result set to end the query at. This is similar to `START_AT` but with it controlling the end position rather than the start position. Requires: * The number of values cannot be greater than the number of fields specified in the `ORDER BY` clause.
2298 &quot;before&quot;: True or False, # If the position is just before or just after the given values, relative to the sort order defined by the query.
2299 &quot;values&quot;: [ # The values that represent a position, in the order they appear in the order by clause of a query. Can contain fewer values than specified in the order by clause.
2300 { # A message that can hold any of the supported value types.
2301 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
2302 &quot;values&quot;: [ # Values in the array.
2303 # Object with schema name: Value
2304 ],
2305 },
2306 &quot;booleanValue&quot;: True or False, # A boolean value.
2307 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
2308 &quot;doubleValue&quot;: 3.14, # A double value.
2309 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
2310 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
2311 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
2312 # Object with schema name: Value
2313 ],
2314 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2315 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2316 &quot;a_key&quot;: # Object with schema name: Value
2317 },
2318 },
2319 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
2320 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
2321 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
2322 },
2323 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
2324 &quot;mapValue&quot;: { # A map value. # A map value.
2325 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
2326 &quot;a_key&quot;: # Object with schema name: Value
2327 },
2328 },
2329 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
2330 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
2331 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
2332 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
2333 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
2334 # Object with schema name: Value
2335 ],
2336 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2337 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2338 &quot;a_key&quot;: # Object with schema name: Value
2339 },
2340 },
2341 ],
2342 },
2343 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
2344 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
2345 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
2346 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
2347 },
2348 ],
2349 },
2350 &quot;findNearest&quot;: { # Nearest Neighbors search config. The ordering provided by FindNearest supersedes the order_by stage. If multiple documents have the same vector distance, the returned document order is not guaranteed to be stable between queries. # Optional. A potential nearest neighbors search. Applies after all other filters and ordering. Finds the closest vector embeddings to the given query vector.
2351 &quot;distanceMeasure&quot;: &quot;A String&quot;, # Required. The distance measure to use, required.
2352 &quot;distanceResultField&quot;: &quot;A String&quot;, # Optional. Optional name of the field to output the result of the vector distance calculation. Must conform to document field name limitations.
2353 &quot;distanceThreshold&quot;: 3.14, # Optional. Option to specify a threshold for which no less similar documents will be returned. The behavior of the specified `distance_measure` will affect the meaning of the distance threshold. Since DOT_PRODUCT distances increase when the vectors are more similar, the comparison is inverted. * For EUCLIDEAN, COSINE: `WHERE distance &lt;= distance_threshold` * For DOT_PRODUCT: `WHERE distance &gt;= distance_threshold`
2354 &quot;limit&quot;: 42, # Required. The number of nearest neighbors to return. Must be a positive integer of no more than 1000.
2355 &quot;queryVector&quot;: { # A message that can hold any of the supported value types. # Required. The query vector that we are searching on. Must be a vector of no more than 2048 dimensions.
2356 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
2357 &quot;values&quot;: [ # Values in the array.
2358 # Object with schema name: Value
2359 ],
2360 },
2361 &quot;booleanValue&quot;: True or False, # A boolean value.
2362 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
2363 &quot;doubleValue&quot;: 3.14, # A double value.
2364 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
2365 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
2366 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
2367 # Object with schema name: Value
2368 ],
2369 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2370 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2371 &quot;a_key&quot;: # Object with schema name: Value
2372 },
2373 },
2374 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
2375 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
2376 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
2377 },
2378 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
2379 &quot;mapValue&quot;: { # A map value. # A map value.
2380 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
2381 &quot;a_key&quot;: # Object with schema name: Value
2382 },
2383 },
2384 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
2385 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
2386 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
2387 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
2388 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
2389 # Object with schema name: Value
2390 ],
2391 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2392 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2393 &quot;a_key&quot;: # Object with schema name: Value
2394 },
2395 },
2396 ],
2397 },
2398 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
2399 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
2400 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
2401 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
2402 },
2403 &quot;vectorField&quot;: { # A reference to a field in a document, ex: `stats.operations`. # Required. An indexed vector field to search upon. Only documents which contain vectors whose dimensionality match the query_vector can be returned.
2404 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
2405 },
2406 },
2407 &quot;from&quot;: [ # The collections to query.
2408 { # A selection of a collection, such as `messages as m1`.
2409 &quot;allDescendants&quot;: True or False, # When false, selects only collections that are immediate children of the `parent` specified in the containing `RunQueryRequest`. When true, selects all descendant collections.
2410 &quot;collectionId&quot;: &quot;A String&quot;, # The collection ID. When set, selects only collections with this ID.
2411 },
2412 ],
2413 &quot;limit&quot;: 42, # The maximum number of results to return. Applies after all other constraints. Requires: * The value must be greater than or equal to zero if specified.
2414 &quot;offset&quot;: 42, # The number of documents to skip before returning the first result. This applies after the constraints specified by the `WHERE`, `START AT`, &amp; `END AT` but before the `LIMIT` clause. Requires: * The value must be greater than or equal to zero if specified.
2415 &quot;orderBy&quot;: [ # The order to apply to the query results. Callers can provide a full ordering, a partial ordering, or no ordering at all. While Firestore will always respect the provided order, the behavior for queries without a full ordering is different per database edition: In Standard edition, Firestore guarantees a stable ordering through the following rules: * The `order_by` is required to reference all fields used with an inequality filter. * All fields that are required to be in the `order_by` but are not already present are appended in lexicographical ordering of the field name. * If an order on `__name__` is not specified, it is appended by default. Fields are appended with the same sort direction as the last order specified, or &#x27;ASCENDING&#x27; if no order was specified. For example: * `ORDER BY a` becomes `ORDER BY a ASC, __name__ ASC` * `ORDER BY a DESC` becomes `ORDER BY a DESC, __name__ DESC` * `WHERE a &gt; 1` becomes `WHERE a &gt; 1 ORDER BY a ASC, __name__ ASC` * `WHERE __name__ &gt; ... AND a &gt; 1` becomes `WHERE __name__ &gt; ... AND a &gt; 1 ORDER BY a ASC, __name__ ASC` In Enterprise edition, Firestore does not guarantee a stable ordering. Instead it will pick the most efficient ordering based on the indexes available at the time of query execution. This will result in a different ordering for queries that are otherwise identical. To ensure a stable ordering, always include a unique field in the `order_by` clause, such as `__name__`.
2416 { # An order on a field.
2417 &quot;direction&quot;: &quot;A String&quot;, # The direction to order by. Defaults to `ASCENDING`.
2418 &quot;field&quot;: { # A reference to a field in a document, ex: `stats.operations`. # The field to order by.
2419 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
2420 },
2421 },
2422 ],
2423 &quot;select&quot;: { # The projection of document&#x27;s fields to return. # Optional sub-set of the fields to return. This acts as a DocumentMask over the documents returned from a query. When not set, assumes that the caller wants all fields returned.
2424 &quot;fields&quot;: [ # The fields to return. If empty, all fields are returned. To only return the name of the document, use `[&#x27;__name__&#x27;]`.
2425 { # A reference to a field in a document, ex: `stats.operations`.
2426 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
2427 },
2428 ],
2429 },
2430 &quot;startAt&quot;: { # A position in a query result set. # A potential prefix of a position in the result set to start the query at. The ordering of the result set is based on the `ORDER BY` clause of the original query. ``` SELECT * FROM k WHERE a = 1 AND b &gt; 2 ORDER BY b ASC, __name__ ASC; ``` This query&#x27;s results are ordered by `(b ASC, __name__ ASC)`. Cursors can reference either the full ordering or a prefix of the location, though it cannot reference more fields than what are in the provided `ORDER BY`. Continuing off the example above, attaching the following start cursors will have varying impact: - `START BEFORE (2, /k/123)`: start the query right before `a = 1 AND b &gt; 2 AND __name__ &gt; /k/123`. - `START AFTER (10)`: start the query right after `a = 1 AND b &gt; 10`. Unlike `OFFSET` which requires scanning over the first N results to skip, a start cursor allows the query to begin at a logical position. This position is not required to match an actual result, it will scan forward from this position to find the next document. Requires: * The number of values cannot be greater than the number of fields specified in the `ORDER BY` clause.
2431 &quot;before&quot;: True or False, # If the position is just before or just after the given values, relative to the sort order defined by the query.
2432 &quot;values&quot;: [ # The values that represent a position, in the order they appear in the order by clause of a query. Can contain fewer values than specified in the order by clause.
2433 { # A message that can hold any of the supported value types.
2434 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
2435 &quot;values&quot;: [ # Values in the array.
2436 # Object with schema name: Value
2437 ],
2438 },
2439 &quot;booleanValue&quot;: True or False, # A boolean value.
2440 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
2441 &quot;doubleValue&quot;: 3.14, # A double value.
2442 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
2443 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
2444 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
2445 # Object with schema name: Value
2446 ],
2447 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2448 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2449 &quot;a_key&quot;: # Object with schema name: Value
2450 },
2451 },
2452 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
2453 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
2454 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
2455 },
2456 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
2457 &quot;mapValue&quot;: { # A map value. # A map value.
2458 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
2459 &quot;a_key&quot;: # Object with schema name: Value
2460 },
2461 },
2462 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
2463 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
2464 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
2465 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
2466 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
2467 # Object with schema name: Value
2468 ],
2469 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2470 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2471 &quot;a_key&quot;: # Object with schema name: Value
2472 },
2473 },
2474 ],
2475 },
2476 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
2477 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
2478 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
2479 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
2480 },
2481 ],
2482 },
2483 &quot;where&quot;: { # A filter. # The filter to apply.
2484 &quot;compositeFilter&quot;: { # A filter that merges multiple other filters using the given operator. # A composite filter.
2485 &quot;filters&quot;: [ # The list of filters to combine. Requires: * At least one filter is present.
2486 # Object with schema name: Filter
2487 ],
2488 &quot;op&quot;: &quot;A String&quot;, # The operator for combining multiple filters.
2489 },
2490 &quot;fieldFilter&quot;: { # A filter on a specific field. # A filter on a document field.
2491 &quot;field&quot;: { # A reference to a field in a document, ex: `stats.operations`. # The field to filter by.
2492 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
2493 },
2494 &quot;op&quot;: &quot;A String&quot;, # The operator to filter by.
2495 &quot;value&quot;: { # A message that can hold any of the supported value types. # The value to compare to.
2496 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
2497 &quot;values&quot;: [ # Values in the array.
2498 # Object with schema name: Value
2499 ],
2500 },
2501 &quot;booleanValue&quot;: True or False, # A boolean value.
2502 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
2503 &quot;doubleValue&quot;: 3.14, # A double value.
2504 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
2505 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
2506 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
2507 # Object with schema name: Value
2508 ],
2509 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2510 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2511 &quot;a_key&quot;: # Object with schema name: Value
2512 },
2513 },
2514 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
2515 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
2516 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
2517 },
2518 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
2519 &quot;mapValue&quot;: { # A map value. # A map value.
2520 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
2521 &quot;a_key&quot;: # Object with schema name: Value
2522 },
2523 },
2524 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
2525 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
2526 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
2527 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
2528 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
2529 # Object with schema name: Value
2530 ],
2531 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2532 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2533 &quot;a_key&quot;: # Object with schema name: Value
2534 },
2535 },
2536 ],
2537 },
2538 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
2539 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
2540 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
2541 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
2542 },
2543 },
2544 &quot;unaryFilter&quot;: { # A filter with a single operand. # A filter that takes exactly one argument.
2545 &quot;field&quot;: { # A reference to a field in a document, ex: `stats.operations`. # The field to which to apply the operator.
2546 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
2547 },
2548 &quot;op&quot;: &quot;A String&quot;, # The unary operator to apply.
2549 },
2550 },
2551 },
2552 }
2553
2554 x__xgafv: string, V1 error format.
2555 Allowed values
2556 1 - v1 error format
2557 2 - v2 error format
2558
2559 Returns:
2560 An object of the form:
2561
2562 { # The response for Firestore.PartitionQuery.
2563 &quot;nextPageToken&quot;: &quot;A String&quot;, # A page token that may be used to request an additional set of results, up to the number specified by `partition_count` in the PartitionQuery request. If blank, there are no more results.
2564 &quot;partitions&quot;: [ # Partition results. Each partition is a split point that can be used by RunQuery as a starting or end point for the query results. The RunQuery requests must be made with the same query supplied to this PartitionQuery request. The partition cursors will be ordered according to same ordering as the results of the query supplied to PartitionQuery. For example, if a PartitionQuery request returns partition cursors A and B, running the following three queries will return the entire result set of the original query: * query, end_at A * query, start_at A, end_at B * query, start_at B An empty result may indicate that the query has too few results to be partitioned, or that the query is not yet supported for partitioning.
2565 { # A position in a query result set.
2566 &quot;before&quot;: True or False, # If the position is just before or just after the given values, relative to the sort order defined by the query.
2567 &quot;values&quot;: [ # The values that represent a position, in the order they appear in the order by clause of a query. Can contain fewer values than specified in the order by clause.
2568 { # A message that can hold any of the supported value types.
2569 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
2570 &quot;values&quot;: [ # Values in the array.
2571 # Object with schema name: Value
2572 ],
2573 },
2574 &quot;booleanValue&quot;: True or False, # A boolean value.
2575 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
2576 &quot;doubleValue&quot;: 3.14, # A double value.
2577 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
2578 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
2579 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
2580 # Object with schema name: Value
2581 ],
2582 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2583 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2584 &quot;a_key&quot;: # Object with schema name: Value
2585 },
2586 },
2587 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
2588 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
2589 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
2590 },
2591 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
2592 &quot;mapValue&quot;: { # A map value. # A map value.
2593 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
2594 &quot;a_key&quot;: # Object with schema name: Value
2595 },
2596 },
2597 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
2598 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
2599 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
2600 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
2601 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
2602 # Object with schema name: Value
2603 ],
2604 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2605 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2606 &quot;a_key&quot;: # Object with schema name: Value
2607 },
2608 },
2609 ],
2610 },
2611 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
2612 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
2613 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
2614 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
2615 },
2616 ],
2617 },
2618 ],
2619 }</pre>
2620 </div>
2621
2622 <div class="method">
2623 <code class="details" id="partitionQuery_next">partitionQuery_next()</code>
2624 <pre>Retrieves the next page of results.
2625
2626 Args:
2627 previous_request: The request for the previous page. (required)
2628 previous_response: The response from the request for the previous page. (required)
2629
2630 Returns:
2631 A request object that you can call &#x27;execute()&#x27; on to request the next
2632 page. Returns None if there are no more items in the collection.
2633 </pre>
2634 </div>
2635
2636 <div class="method">
2637 <code class="details" id="patch">patch(name, body=None, currentDocument_exists=None, currentDocument_updateTime=None, mask_fieldPaths=None, updateMask_fieldPaths=None, x__xgafv=None)</code>
2638 <pre>Updates or inserts a document.
2639
2640 Args:
2641 name: string, The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`. (required)
2642 body: object, The request body.
2643 The object takes the form of:
2644
2645 { # A Firestore document. Must not exceed 1 MiB - 4 bytes.
2646 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was created. This value increases monotonically when a document is deleted then recreated. It can also be compared to values from other documents and the `read_time` of a query.
2647 &quot;fields&quot;: { # The document&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The field names, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. Field paths may be used in other contexts to refer to structured fields defined here. For `map_value`, the field path is represented by a dot-delimited (`.`) string of segments. Each segment is either a simple field name (defined below) or a quoted field name. For example, the structured field `&quot;foo&quot; : { map_value: { &quot;x&amp;y&quot; : { string_value: &quot;hello&quot; }}}` would be represented by the field path `` foo.`x&amp;y` ``. A simple field name contains only characters `a` to `z`, `A` to `Z`, `0` to `9`, or `_`, and must not start with `0` to `9`. For example, `foo_bar_17`. A quoted field name starts and ends with `` ` `` and may contain any character. Some characters, including `` ` ``, must be escaped using a `\`. For example, `` `x&amp;y` `` represents `x&amp;y` and `` `bak\`tik` `` represents `` bak`tik ``.
2648 &quot;a_key&quot;: { # A message that can hold any of the supported value types.
2649 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
2650 &quot;values&quot;: [ # Values in the array.
2651 # Object with schema name: Value
2652 ],
2653 },
2654 &quot;booleanValue&quot;: True or False, # A boolean value.
2655 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
2656 &quot;doubleValue&quot;: 3.14, # A double value.
2657 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
2658 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
2659 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
2660 # Object with schema name: Value
2661 ],
2662 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2663 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2664 &quot;a_key&quot;: # Object with schema name: Value
2665 },
2666 },
2667 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
2668 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
2669 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
2670 },
2671 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
2672 &quot;mapValue&quot;: { # A map value. # A map value.
2673 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
2674 &quot;a_key&quot;: # Object with schema name: Value
2675 },
2676 },
2677 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
2678 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
2679 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
2680 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
2681 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
2682 # Object with schema name: Value
2683 ],
2684 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2685 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2686 &quot;a_key&quot;: # Object with schema name: Value
2687 },
2688 },
2689 ],
2690 },
2691 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
2692 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
2693 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
2694 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
2695 },
2696 },
2697 &quot;name&quot;: &quot;A String&quot;, # The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
2698 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was last changed. This value is initially set to the `create_time` then increases monotonically with each change to the document. It can also be compared to values from other documents and the `read_time` of a query.
2699 }
2700
2701 currentDocument_exists: boolean, When set to `true`, the target document must exist. When set to `false`, the target document must not exist.
2702 currentDocument_updateTime: string, When set, the target document must exist and have been last updated at that time. Timestamp must be microsecond aligned.
2703 mask_fieldPaths: string, The list of field paths in the mask. See Document.fields for a field path syntax reference. (repeated)
2704 updateMask_fieldPaths: string, The list of field paths in the mask. See Document.fields for a field path syntax reference. (repeated)
2705 x__xgafv: string, V1 error format.
2706 Allowed values
2707 1 - v1 error format
2708 2 - v2 error format
2709
2710 Returns:
2711 An object of the form:
2712
2713 { # A Firestore document. Must not exceed 1 MiB - 4 bytes.
2714 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was created. This value increases monotonically when a document is deleted then recreated. It can also be compared to values from other documents and the `read_time` of a query.
2715 &quot;fields&quot;: { # The document&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The field names, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. Field paths may be used in other contexts to refer to structured fields defined here. For `map_value`, the field path is represented by a dot-delimited (`.`) string of segments. Each segment is either a simple field name (defined below) or a quoted field name. For example, the structured field `&quot;foo&quot; : { map_value: { &quot;x&amp;y&quot; : { string_value: &quot;hello&quot; }}}` would be represented by the field path `` foo.`x&amp;y` ``. A simple field name contains only characters `a` to `z`, `A` to `Z`, `0` to `9`, or `_`, and must not start with `0` to `9`. For example, `foo_bar_17`. A quoted field name starts and ends with `` ` `` and may contain any character. Some characters, including `` ` ``, must be escaped using a `\`. For example, `` `x&amp;y` `` represents `x&amp;y` and `` `bak\`tik` `` represents `` bak`tik ``.
2716 &quot;a_key&quot;: { # A message that can hold any of the supported value types.
2717 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
2718 &quot;values&quot;: [ # Values in the array.
2719 # Object with schema name: Value
2720 ],
2721 },
2722 &quot;booleanValue&quot;: True or False, # A boolean value.
2723 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
2724 &quot;doubleValue&quot;: 3.14, # A double value.
2725 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
2726 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
2727 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
2728 # Object with schema name: Value
2729 ],
2730 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2731 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2732 &quot;a_key&quot;: # Object with schema name: Value
2733 },
2734 },
2735 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
2736 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
2737 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
2738 },
2739 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
2740 &quot;mapValue&quot;: { # A map value. # A map value.
2741 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
2742 &quot;a_key&quot;: # Object with schema name: Value
2743 },
2744 },
2745 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
2746 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
2747 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
2748 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
2749 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
2750 # Object with schema name: Value
2751 ],
2752 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2753 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2754 &quot;a_key&quot;: # Object with schema name: Value
2755 },
2756 },
2757 ],
2758 },
2759 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
2760 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
2761 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
2762 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
2763 },
2764 },
2765 &quot;name&quot;: &quot;A String&quot;, # The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
2766 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was last changed. This value is initially set to the `create_time` then increases monotonically with each change to the document. It can also be compared to values from other documents and the `read_time` of a query.
2767 }</pre>
2768 </div>
2769
2770 <div class="method">
2771 <code class="details" id="rollback">rollback(database, body=None, x__xgafv=None)</code>
2772 <pre>Rolls back a transaction.
2773
2774 Args:
2775 database: string, Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. (required)
2776 body: object, The request body.
2777 The object takes the form of:
2778
2779 { # The request for Firestore.Rollback.
2780 &quot;transaction&quot;: &quot;A String&quot;, # Required. The transaction to roll back.
2781 }
2782
2783 x__xgafv: string, V1 error format.
2784 Allowed values
2785 1 - v1 error format
2786 2 - v2 error format
2787
2788 Returns:
2789 An object of the form:
2790
2791 { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
2792 }</pre>
2793 </div>
2794
2795 <div class="method">
2796 <code class="details" id="runAggregationQuery">runAggregationQuery(parent, body=None, x__xgafv=None)</code>
2797 <pre>Runs an aggregation query. Rather than producing Document results like Firestore.RunQuery, this API allows running an aggregation to produce a series of AggregationResult server-side. High-Level Example: ``` -- Return the number of documents in table given a filter. SELECT COUNT(*) FROM ( SELECT * FROM k where a = true ); ```
2798
2799 Args:
2800 parent: string, Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents` or `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` (required)
2801 body: object, The request body.
2802 The object takes the form of:
2803
2804 { # The request for Firestore.RunAggregationQuery.
2805 &quot;explainOptions&quot;: { # Explain options for the query. # Optional. Explain options for the query. If set, additional query statistics will be returned. If not, only query results will be returned.
2806 &quot;analyze&quot;: True or False, # Optional. Whether to execute this query. When false (the default), the query will be planned, returning only metrics from the planning stages. When true, the query will be planned and executed, returning the full query results along with both planning and execution stage metrics.
2807 },
2808 &quot;newTransaction&quot;: { # Options for creating a new transaction. # Starts a new transaction as part of the query, defaulting to read-only. The new transaction ID will be returned as the first response in the stream.
2809 &quot;readOnly&quot;: { # Options for a transaction that can only be used to read documents. # The transaction can only be used for read operations.
2810 &quot;readTime&quot;: &quot;A String&quot;, # Reads documents 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.
2811 },
2812 &quot;readWrite&quot;: { # Options for a transaction that can be used to read and write documents. # The transaction can be used for both read and write operations.
2813 &quot;concurrencyMode&quot;: &quot;A String&quot;, # Optional. The concurrency control mode to use for this transaction. A database is able to use different concurrency modes for different transactions simultaneously. 3rd party auth requests are only allowed to create optimistic read-write transactions and must specify that here even if the database-level setting is already configured to optimistic.
2814 &quot;retryTransaction&quot;: &quot;A String&quot;, # An optional transaction to retry.
2815 },
2816 },
2817 &quot;readTime&quot;: &quot;A String&quot;, # Executes the query at the given timestamp. 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.
2818 &quot;structuredAggregationQuery&quot;: { # Firestore query for running an aggregation over a StructuredQuery. # An aggregation query.
2819 &quot;aggregations&quot;: [ # Optional. Series of aggregations to apply over the results of the `structured_query`. Requires: * A minimum of one and maximum of five aggregations per query.
2820 { # Defines an aggregation that produces a single result.
2821 &quot;alias&quot;: &quot;A String&quot;, # Optional. Optional name of the field to store the result of the aggregation into. If not provided, Firestore will pick a default name following the format `field_`. For example: ``` AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2), COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) OVER ( ... ); ``` becomes: ``` AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2) AS field_1, COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) AS field_2 OVER ( ... ); ``` Requires: * Must be unique across all aggregation aliases. * Conform to document field name limitations.
2822 &quot;avg&quot;: { # Average of the values of the requested field. * Only numeric values will be aggregated. All non-numeric values including `NULL` are skipped. * If the aggregated values contain `NaN`, returns `NaN`. Infinity math follows IEEE-754 standards. * If the aggregated value set is empty, returns `NULL`. * Always returns the result as a double. # Average aggregator.
2823 &quot;field&quot;: { # A reference to a field in a document, ex: `stats.operations`. # The field to aggregate on.
2824 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
2825 },
2826 },
2827 &quot;count&quot;: { # Count of documents that match the query. The `COUNT(*)` aggregation function operates on the entire document so it does not require a field reference. # Count aggregator.
2828 &quot;upTo&quot;: &quot;A String&quot;, # Optional. Optional constraint on the maximum number of documents to count. This provides a way to set an upper bound on the number of documents to scan, limiting latency, and cost. Unspecified is interpreted as no bound. High-Level Example: ``` AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); ``` Requires: * Must be greater than zero when present.
2829 },
2830 &quot;sum&quot;: { # Sum of the values of the requested field. * Only numeric values will be aggregated. All non-numeric values including `NULL` are skipped. * If the aggregated values contain `NaN`, returns `NaN`. Infinity math follows IEEE-754 standards. * If the aggregated value set is empty, returns 0. * Returns a 64-bit integer if all aggregated numbers are integers and the sum result does not overflow. Otherwise, the result is returned as a double. Note that even if all the aggregated values are integers, the result is returned as a double if it cannot fit within a 64-bit signed integer. When this occurs, the returned value will lose precision. * When underflow occurs, floating-point aggregation is non-deterministic. This means that running the same query repeatedly without any changes to the underlying values could produce slightly different results each time. In those cases, values should be stored as integers over floating-point numbers. # Sum aggregator.
2831 &quot;field&quot;: { # A reference to a field in a document, ex: `stats.operations`. # The field to aggregate on.
2832 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
2833 },
2834 },
2835 },
2836 ],
2837 &quot;structuredQuery&quot;: { # A Firestore query. The query stages are executed in the following order: 1. from 2. where 3. select 4. order_by + start_at + end_at 5. offset 6. limit 7. find_nearest # Nested structured query.
2838 &quot;endAt&quot;: { # A position in a query result set. # A potential prefix of a position in the result set to end the query at. This is similar to `START_AT` but with it controlling the end position rather than the start position. Requires: * The number of values cannot be greater than the number of fields specified in the `ORDER BY` clause.
2839 &quot;before&quot;: True or False, # If the position is just before or just after the given values, relative to the sort order defined by the query.
2840 &quot;values&quot;: [ # The values that represent a position, in the order they appear in the order by clause of a query. Can contain fewer values than specified in the order by clause.
2841 { # A message that can hold any of the supported value types.
2842 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
2843 &quot;values&quot;: [ # Values in the array.
2844 # Object with schema name: Value
2845 ],
2846 },
2847 &quot;booleanValue&quot;: True or False, # A boolean value.
2848 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
2849 &quot;doubleValue&quot;: 3.14, # A double value.
2850 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
2851 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
2852 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
2853 # Object with schema name: Value
2854 ],
2855 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2856 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2857 &quot;a_key&quot;: # Object with schema name: Value
2858 },
2859 },
2860 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
2861 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
2862 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
2863 },
2864 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
2865 &quot;mapValue&quot;: { # A map value. # A map value.
2866 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
2867 &quot;a_key&quot;: # Object with schema name: Value
2868 },
2869 },
2870 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
2871 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
2872 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
2873 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
2874 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
2875 # Object with schema name: Value
2876 ],
2877 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2878 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2879 &quot;a_key&quot;: # Object with schema name: Value
2880 },
2881 },
2882 ],
2883 },
2884 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
2885 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
2886 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
2887 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
2888 },
2889 ],
2890 },
2891 &quot;findNearest&quot;: { # Nearest Neighbors search config. The ordering provided by FindNearest supersedes the order_by stage. If multiple documents have the same vector distance, the returned document order is not guaranteed to be stable between queries. # Optional. A potential nearest neighbors search. Applies after all other filters and ordering. Finds the closest vector embeddings to the given query vector.
2892 &quot;distanceMeasure&quot;: &quot;A String&quot;, # Required. The distance measure to use, required.
2893 &quot;distanceResultField&quot;: &quot;A String&quot;, # Optional. Optional name of the field to output the result of the vector distance calculation. Must conform to document field name limitations.
2894 &quot;distanceThreshold&quot;: 3.14, # Optional. Option to specify a threshold for which no less similar documents will be returned. The behavior of the specified `distance_measure` will affect the meaning of the distance threshold. Since DOT_PRODUCT distances increase when the vectors are more similar, the comparison is inverted. * For EUCLIDEAN, COSINE: `WHERE distance &lt;= distance_threshold` * For DOT_PRODUCT: `WHERE distance &gt;= distance_threshold`
2895 &quot;limit&quot;: 42, # Required. The number of nearest neighbors to return. Must be a positive integer of no more than 1000.
2896 &quot;queryVector&quot;: { # A message that can hold any of the supported value types. # Required. The query vector that we are searching on. Must be a vector of no more than 2048 dimensions.
2897 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
2898 &quot;values&quot;: [ # Values in the array.
2899 # Object with schema name: Value
2900 ],
2901 },
2902 &quot;booleanValue&quot;: True or False, # A boolean value.
2903 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
2904 &quot;doubleValue&quot;: 3.14, # A double value.
2905 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
2906 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
2907 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
2908 # Object with schema name: Value
2909 ],
2910 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2911 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2912 &quot;a_key&quot;: # Object with schema name: Value
2913 },
2914 },
2915 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
2916 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
2917 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
2918 },
2919 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
2920 &quot;mapValue&quot;: { # A map value. # A map value.
2921 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
2922 &quot;a_key&quot;: # Object with schema name: Value
2923 },
2924 },
2925 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
2926 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
2927 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
2928 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
2929 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
2930 # Object with schema name: Value
2931 ],
2932 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2933 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2934 &quot;a_key&quot;: # Object with schema name: Value
2935 },
2936 },
2937 ],
2938 },
2939 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
2940 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
2941 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
2942 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
2943 },
2944 &quot;vectorField&quot;: { # A reference to a field in a document, ex: `stats.operations`. # Required. An indexed vector field to search upon. Only documents which contain vectors whose dimensionality match the query_vector can be returned.
2945 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
2946 },
2947 },
2948 &quot;from&quot;: [ # The collections to query.
2949 { # A selection of a collection, such as `messages as m1`.
2950 &quot;allDescendants&quot;: True or False, # When false, selects only collections that are immediate children of the `parent` specified in the containing `RunQueryRequest`. When true, selects all descendant collections.
2951 &quot;collectionId&quot;: &quot;A String&quot;, # The collection ID. When set, selects only collections with this ID.
2952 },
2953 ],
2954 &quot;limit&quot;: 42, # The maximum number of results to return. Applies after all other constraints. Requires: * The value must be greater than or equal to zero if specified.
2955 &quot;offset&quot;: 42, # The number of documents to skip before returning the first result. This applies after the constraints specified by the `WHERE`, `START AT`, &amp; `END AT` but before the `LIMIT` clause. Requires: * The value must be greater than or equal to zero if specified.
2956 &quot;orderBy&quot;: [ # The order to apply to the query results. Callers can provide a full ordering, a partial ordering, or no ordering at all. While Firestore will always respect the provided order, the behavior for queries without a full ordering is different per database edition: In Standard edition, Firestore guarantees a stable ordering through the following rules: * The `order_by` is required to reference all fields used with an inequality filter. * All fields that are required to be in the `order_by` but are not already present are appended in lexicographical ordering of the field name. * If an order on `__name__` is not specified, it is appended by default. Fields are appended with the same sort direction as the last order specified, or &#x27;ASCENDING&#x27; if no order was specified. For example: * `ORDER BY a` becomes `ORDER BY a ASC, __name__ ASC` * `ORDER BY a DESC` becomes `ORDER BY a DESC, __name__ DESC` * `WHERE a &gt; 1` becomes `WHERE a &gt; 1 ORDER BY a ASC, __name__ ASC` * `WHERE __name__ &gt; ... AND a &gt; 1` becomes `WHERE __name__ &gt; ... AND a &gt; 1 ORDER BY a ASC, __name__ ASC` In Enterprise edition, Firestore does not guarantee a stable ordering. Instead it will pick the most efficient ordering based on the indexes available at the time of query execution. This will result in a different ordering for queries that are otherwise identical. To ensure a stable ordering, always include a unique field in the `order_by` clause, such as `__name__`.
2957 { # An order on a field.
2958 &quot;direction&quot;: &quot;A String&quot;, # The direction to order by. Defaults to `ASCENDING`.
2959 &quot;field&quot;: { # A reference to a field in a document, ex: `stats.operations`. # The field to order by.
2960 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
2961 },
2962 },
2963 ],
2964 &quot;select&quot;: { # The projection of document&#x27;s fields to return. # Optional sub-set of the fields to return. This acts as a DocumentMask over the documents returned from a query. When not set, assumes that the caller wants all fields returned.
2965 &quot;fields&quot;: [ # The fields to return. If empty, all fields are returned. To only return the name of the document, use `[&#x27;__name__&#x27;]`.
2966 { # A reference to a field in a document, ex: `stats.operations`.
2967 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
2968 },
2969 ],
2970 },
2971 &quot;startAt&quot;: { # A position in a query result set. # A potential prefix of a position in the result set to start the query at. The ordering of the result set is based on the `ORDER BY` clause of the original query. ``` SELECT * FROM k WHERE a = 1 AND b &gt; 2 ORDER BY b ASC, __name__ ASC; ``` This query&#x27;s results are ordered by `(b ASC, __name__ ASC)`. Cursors can reference either the full ordering or a prefix of the location, though it cannot reference more fields than what are in the provided `ORDER BY`. Continuing off the example above, attaching the following start cursors will have varying impact: - `START BEFORE (2, /k/123)`: start the query right before `a = 1 AND b &gt; 2 AND __name__ &gt; /k/123`. - `START AFTER (10)`: start the query right after `a = 1 AND b &gt; 10`. Unlike `OFFSET` which requires scanning over the first N results to skip, a start cursor allows the query to begin at a logical position. This position is not required to match an actual result, it will scan forward from this position to find the next document. Requires: * The number of values cannot be greater than the number of fields specified in the `ORDER BY` clause.
2972 &quot;before&quot;: True or False, # If the position is just before or just after the given values, relative to the sort order defined by the query.
2973 &quot;values&quot;: [ # The values that represent a position, in the order they appear in the order by clause of a query. Can contain fewer values than specified in the order by clause.
2974 { # A message that can hold any of the supported value types.
2975 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
2976 &quot;values&quot;: [ # Values in the array.
2977 # Object with schema name: Value
2978 ],
2979 },
2980 &quot;booleanValue&quot;: True or False, # A boolean value.
2981 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
2982 &quot;doubleValue&quot;: 3.14, # A double value.
2983 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
2984 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
2985 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
2986 # Object with schema name: Value
2987 ],
2988 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
2989 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
2990 &quot;a_key&quot;: # Object with schema name: Value
2991 },
2992 },
2993 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
2994 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
2995 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
2996 },
2997 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
2998 &quot;mapValue&quot;: { # A map value. # A map value.
2999 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
3000 &quot;a_key&quot;: # Object with schema name: Value
3001 },
3002 },
3003 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
3004 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
3005 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
3006 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
3007 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
3008 # Object with schema name: Value
3009 ],
3010 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3011 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3012 &quot;a_key&quot;: # Object with schema name: Value
3013 },
3014 },
3015 ],
3016 },
3017 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
3018 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
3019 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
3020 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
3021 },
3022 ],
3023 },
3024 &quot;where&quot;: { # A filter. # The filter to apply.
3025 &quot;compositeFilter&quot;: { # A filter that merges multiple other filters using the given operator. # A composite filter.
3026 &quot;filters&quot;: [ # The list of filters to combine. Requires: * At least one filter is present.
3027 # Object with schema name: Filter
3028 ],
3029 &quot;op&quot;: &quot;A String&quot;, # The operator for combining multiple filters.
3030 },
3031 &quot;fieldFilter&quot;: { # A filter on a specific field. # A filter on a document field.
3032 &quot;field&quot;: { # A reference to a field in a document, ex: `stats.operations`. # The field to filter by.
3033 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
3034 },
3035 &quot;op&quot;: &quot;A String&quot;, # The operator to filter by.
3036 &quot;value&quot;: { # A message that can hold any of the supported value types. # The value to compare to.
3037 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
3038 &quot;values&quot;: [ # Values in the array.
3039 # Object with schema name: Value
3040 ],
3041 },
3042 &quot;booleanValue&quot;: True or False, # A boolean value.
3043 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
3044 &quot;doubleValue&quot;: 3.14, # A double value.
3045 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
3046 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
3047 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
3048 # Object with schema name: Value
3049 ],
3050 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3051 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3052 &quot;a_key&quot;: # Object with schema name: Value
3053 },
3054 },
3055 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
3056 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
3057 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
3058 },
3059 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
3060 &quot;mapValue&quot;: { # A map value. # A map value.
3061 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
3062 &quot;a_key&quot;: # Object with schema name: Value
3063 },
3064 },
3065 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
3066 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
3067 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
3068 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
3069 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
3070 # Object with schema name: Value
3071 ],
3072 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3073 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3074 &quot;a_key&quot;: # Object with schema name: Value
3075 },
3076 },
3077 ],
3078 },
3079 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
3080 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
3081 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
3082 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
3083 },
3084 },
3085 &quot;unaryFilter&quot;: { # A filter with a single operand. # A filter that takes exactly one argument.
3086 &quot;field&quot;: { # A reference to a field in a document, ex: `stats.operations`. # The field to which to apply the operator.
3087 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
3088 },
3089 &quot;op&quot;: &quot;A String&quot;, # The unary operator to apply.
3090 },
3091 },
3092 },
3093 },
3094 &quot;transaction&quot;: &quot;A String&quot;, # Run the aggregation within an already active transaction. The value here is the opaque transaction ID to execute the query in.
3095 }
3096
3097 x__xgafv: string, V1 error format.
3098 Allowed values
3099 1 - v1 error format
3100 2 - v2 error format
3101
3102 Returns:
3103 An object of the form:
3104
3105 { # The response for Firestore.RunAggregationQuery.
3106 &quot;explainMetrics&quot;: { # Explain metrics for the query. # Query explain metrics. This is only present when the RunAggregationQueryRequest.explain_options is provided, and it is sent only once with the last response in the stream.
3107 &quot;executionStats&quot;: { # Execution statistics for the query. # Aggregated stats from the execution of the query. Only present when ExplainOptions.analyze is set to true.
3108 &quot;debugStats&quot;: { # Debugging statistics from the execution of the query. Note that the debugging stats are subject to change as Firestore evolves. It could include: { &quot;indexes_entries_scanned&quot;: &quot;1000&quot;, &quot;documents_scanned&quot;: &quot;20&quot;, &quot;billing_details&quot; : { &quot;documents_billable&quot;: &quot;20&quot;, &quot;index_entries_billable&quot;: &quot;1000&quot;, &quot;min_query_cost&quot;: &quot;0&quot; } }
3109 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
3110 },
3111 &quot;executionDuration&quot;: &quot;A String&quot;, # Total time to execute the query in the backend.
3112 &quot;readOperations&quot;: &quot;A String&quot;, # Total billable read operations.
3113 &quot;resultsReturned&quot;: &quot;A String&quot;, # Total number of results returned, including documents, projections, aggregation results, keys.
3114 },
3115 &quot;planSummary&quot;: { # Planning phase information for the query. # Planning phase information for the query.
3116 &quot;indexesUsed&quot;: [ # The indexes selected for the query. For example: [ {&quot;query_scope&quot;: &quot;Collection&quot;, &quot;properties&quot;: &quot;(foo ASC, __name__ ASC)&quot;}, {&quot;query_scope&quot;: &quot;Collection&quot;, &quot;properties&quot;: &quot;(bar ASC, __name__ ASC)&quot;} ]
3117 {
3118 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
3119 },
3120 ],
3121 },
3122 },
3123 &quot;readTime&quot;: &quot;A String&quot;, # The time at which the aggregate result was computed. This is always monotonically increasing; in this case, the previous AggregationResult in the result stream are guaranteed not to have changed between their `read_time` and this one. If the query returns no results, a response with `read_time` and no `result` will be sent, and this represents the time at which the query was run.
3124 &quot;result&quot;: { # The result of a single bucket from a Firestore aggregation query. The keys of `aggregate_fields` are the same for all results in an aggregation query, unlike document queries which can have different fields present for each result. # A single aggregation result. Not present when reporting partial progress.
3125 &quot;aggregateFields&quot;: { # The result of the aggregation functions, ex: `COUNT(*) AS total_docs`. The key is the alias assigned to the aggregation function on input and the size of this map equals the number of aggregation functions in the query.
3126 &quot;a_key&quot;: { # A message that can hold any of the supported value types.
3127 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
3128 &quot;values&quot;: [ # Values in the array.
3129 # Object with schema name: Value
3130 ],
3131 },
3132 &quot;booleanValue&quot;: True or False, # A boolean value.
3133 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
3134 &quot;doubleValue&quot;: 3.14, # A double value.
3135 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
3136 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
3137 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
3138 # Object with schema name: Value
3139 ],
3140 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3141 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3142 &quot;a_key&quot;: # Object with schema name: Value
3143 },
3144 },
3145 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
3146 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
3147 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
3148 },
3149 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
3150 &quot;mapValue&quot;: { # A map value. # A map value.
3151 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
3152 &quot;a_key&quot;: # Object with schema name: Value
3153 },
3154 },
3155 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
3156 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
3157 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
3158 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
3159 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
3160 # Object with schema name: Value
3161 ],
3162 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3163 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3164 &quot;a_key&quot;: # Object with schema name: Value
3165 },
3166 },
3167 ],
3168 },
3169 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
3170 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
3171 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
3172 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
3173 },
3174 },
3175 },
3176 &quot;transaction&quot;: &quot;A String&quot;, # The transaction that was started as part of this request. Only present on the first response when the request requested to start a new transaction.
3177 }</pre>
3178 </div>
3179
3180 <div class="method">
3181 <code class="details" id="runQuery">runQuery(parent, body=None, x__xgafv=None)</code>
3182 <pre>Runs a query.
3183
3184 Args:
3185 parent: string, Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents` or `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` (required)
3186 body: object, The request body.
3187 The object takes the form of:
3188
3189 { # The request for Firestore.RunQuery.
3190 &quot;explainOptions&quot;: { # Explain options for the query. # Optional. Explain options for the query. If set, additional query statistics will be returned. If not, only query results will be returned.
3191 &quot;analyze&quot;: True or False, # Optional. Whether to execute this query. When false (the default), the query will be planned, returning only metrics from the planning stages. When true, the query will be planned and executed, returning the full query results along with both planning and execution stage metrics.
3192 },
3193 &quot;newTransaction&quot;: { # Options for creating a new transaction. # Starts a new transaction and reads the documents. Defaults to a read-only transaction. The new transaction ID will be returned as the first response in the stream.
3194 &quot;readOnly&quot;: { # Options for a transaction that can only be used to read documents. # The transaction can only be used for read operations.
3195 &quot;readTime&quot;: &quot;A String&quot;, # Reads documents 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.
3196 },
3197 &quot;readWrite&quot;: { # Options for a transaction that can be used to read and write documents. # The transaction can be used for both read and write operations.
3198 &quot;concurrencyMode&quot;: &quot;A String&quot;, # Optional. The concurrency control mode to use for this transaction. A database is able to use different concurrency modes for different transactions simultaneously. 3rd party auth requests are only allowed to create optimistic read-write transactions and must specify that here even if the database-level setting is already configured to optimistic.
3199 &quot;retryTransaction&quot;: &quot;A String&quot;, # An optional transaction to retry.
3200 },
3201 },
3202 &quot;readTime&quot;: &quot;A String&quot;, # Reads documents as they were 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.
3203 &quot;structuredQuery&quot;: { # A Firestore query. The query stages are executed in the following order: 1. from 2. where 3. select 4. order_by + start_at + end_at 5. offset 6. limit 7. find_nearest # A structured query.
3204 &quot;endAt&quot;: { # A position in a query result set. # A potential prefix of a position in the result set to end the query at. This is similar to `START_AT` but with it controlling the end position rather than the start position. Requires: * The number of values cannot be greater than the number of fields specified in the `ORDER BY` clause.
3205 &quot;before&quot;: True or False, # If the position is just before or just after the given values, relative to the sort order defined by the query.
3206 &quot;values&quot;: [ # The values that represent a position, in the order they appear in the order by clause of a query. Can contain fewer values than specified in the order by clause.
3207 { # A message that can hold any of the supported value types.
3208 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
3209 &quot;values&quot;: [ # Values in the array.
3210 # Object with schema name: Value
3211 ],
3212 },
3213 &quot;booleanValue&quot;: True or False, # A boolean value.
3214 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
3215 &quot;doubleValue&quot;: 3.14, # A double value.
3216 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
3217 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
3218 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
3219 # Object with schema name: Value
3220 ],
3221 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3222 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3223 &quot;a_key&quot;: # Object with schema name: Value
3224 },
3225 },
3226 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
3227 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
3228 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
3229 },
3230 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
3231 &quot;mapValue&quot;: { # A map value. # A map value.
3232 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
3233 &quot;a_key&quot;: # Object with schema name: Value
3234 },
3235 },
3236 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
3237 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
3238 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
3239 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
3240 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
3241 # Object with schema name: Value
3242 ],
3243 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3244 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3245 &quot;a_key&quot;: # Object with schema name: Value
3246 },
3247 },
3248 ],
3249 },
3250 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
3251 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
3252 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
3253 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
3254 },
3255 ],
3256 },
3257 &quot;findNearest&quot;: { # Nearest Neighbors search config. The ordering provided by FindNearest supersedes the order_by stage. If multiple documents have the same vector distance, the returned document order is not guaranteed to be stable between queries. # Optional. A potential nearest neighbors search. Applies after all other filters and ordering. Finds the closest vector embeddings to the given query vector.
3258 &quot;distanceMeasure&quot;: &quot;A String&quot;, # Required. The distance measure to use, required.
3259 &quot;distanceResultField&quot;: &quot;A String&quot;, # Optional. Optional name of the field to output the result of the vector distance calculation. Must conform to document field name limitations.
3260 &quot;distanceThreshold&quot;: 3.14, # Optional. Option to specify a threshold for which no less similar documents will be returned. The behavior of the specified `distance_measure` will affect the meaning of the distance threshold. Since DOT_PRODUCT distances increase when the vectors are more similar, the comparison is inverted. * For EUCLIDEAN, COSINE: `WHERE distance &lt;= distance_threshold` * For DOT_PRODUCT: `WHERE distance &gt;= distance_threshold`
3261 &quot;limit&quot;: 42, # Required. The number of nearest neighbors to return. Must be a positive integer of no more than 1000.
3262 &quot;queryVector&quot;: { # A message that can hold any of the supported value types. # Required. The query vector that we are searching on. Must be a vector of no more than 2048 dimensions.
3263 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
3264 &quot;values&quot;: [ # Values in the array.
3265 # Object with schema name: Value
3266 ],
3267 },
3268 &quot;booleanValue&quot;: True or False, # A boolean value.
3269 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
3270 &quot;doubleValue&quot;: 3.14, # A double value.
3271 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
3272 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
3273 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
3274 # Object with schema name: Value
3275 ],
3276 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3277 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3278 &quot;a_key&quot;: # Object with schema name: Value
3279 },
3280 },
3281 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
3282 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
3283 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
3284 },
3285 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
3286 &quot;mapValue&quot;: { # A map value. # A map value.
3287 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
3288 &quot;a_key&quot;: # Object with schema name: Value
3289 },
3290 },
3291 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
3292 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
3293 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
3294 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
3295 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
3296 # Object with schema name: Value
3297 ],
3298 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3299 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3300 &quot;a_key&quot;: # Object with schema name: Value
3301 },
3302 },
3303 ],
3304 },
3305 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
3306 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
3307 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
3308 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
3309 },
3310 &quot;vectorField&quot;: { # A reference to a field in a document, ex: `stats.operations`. # Required. An indexed vector field to search upon. Only documents which contain vectors whose dimensionality match the query_vector can be returned.
3311 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
3312 },
3313 },
3314 &quot;from&quot;: [ # The collections to query.
3315 { # A selection of a collection, such as `messages as m1`.
3316 &quot;allDescendants&quot;: True or False, # When false, selects only collections that are immediate children of the `parent` specified in the containing `RunQueryRequest`. When true, selects all descendant collections.
3317 &quot;collectionId&quot;: &quot;A String&quot;, # The collection ID. When set, selects only collections with this ID.
3318 },
3319 ],
3320 &quot;limit&quot;: 42, # The maximum number of results to return. Applies after all other constraints. Requires: * The value must be greater than or equal to zero if specified.
3321 &quot;offset&quot;: 42, # The number of documents to skip before returning the first result. This applies after the constraints specified by the `WHERE`, `START AT`, &amp; `END AT` but before the `LIMIT` clause. Requires: * The value must be greater than or equal to zero if specified.
3322 &quot;orderBy&quot;: [ # The order to apply to the query results. Callers can provide a full ordering, a partial ordering, or no ordering at all. While Firestore will always respect the provided order, the behavior for queries without a full ordering is different per database edition: In Standard edition, Firestore guarantees a stable ordering through the following rules: * The `order_by` is required to reference all fields used with an inequality filter. * All fields that are required to be in the `order_by` but are not already present are appended in lexicographical ordering of the field name. * If an order on `__name__` is not specified, it is appended by default. Fields are appended with the same sort direction as the last order specified, or &#x27;ASCENDING&#x27; if no order was specified. For example: * `ORDER BY a` becomes `ORDER BY a ASC, __name__ ASC` * `ORDER BY a DESC` becomes `ORDER BY a DESC, __name__ DESC` * `WHERE a &gt; 1` becomes `WHERE a &gt; 1 ORDER BY a ASC, __name__ ASC` * `WHERE __name__ &gt; ... AND a &gt; 1` becomes `WHERE __name__ &gt; ... AND a &gt; 1 ORDER BY a ASC, __name__ ASC` In Enterprise edition, Firestore does not guarantee a stable ordering. Instead it will pick the most efficient ordering based on the indexes available at the time of query execution. This will result in a different ordering for queries that are otherwise identical. To ensure a stable ordering, always include a unique field in the `order_by` clause, such as `__name__`.
3323 { # An order on a field.
3324 &quot;direction&quot;: &quot;A String&quot;, # The direction to order by. Defaults to `ASCENDING`.
3325 &quot;field&quot;: { # A reference to a field in a document, ex: `stats.operations`. # The field to order by.
3326 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
3327 },
3328 },
3329 ],
3330 &quot;select&quot;: { # The projection of document&#x27;s fields to return. # Optional sub-set of the fields to return. This acts as a DocumentMask over the documents returned from a query. When not set, assumes that the caller wants all fields returned.
3331 &quot;fields&quot;: [ # The fields to return. If empty, all fields are returned. To only return the name of the document, use `[&#x27;__name__&#x27;]`.
3332 { # A reference to a field in a document, ex: `stats.operations`.
3333 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
3334 },
3335 ],
3336 },
3337 &quot;startAt&quot;: { # A position in a query result set. # A potential prefix of a position in the result set to start the query at. The ordering of the result set is based on the `ORDER BY` clause of the original query. ``` SELECT * FROM k WHERE a = 1 AND b &gt; 2 ORDER BY b ASC, __name__ ASC; ``` This query&#x27;s results are ordered by `(b ASC, __name__ ASC)`. Cursors can reference either the full ordering or a prefix of the location, though it cannot reference more fields than what are in the provided `ORDER BY`. Continuing off the example above, attaching the following start cursors will have varying impact: - `START BEFORE (2, /k/123)`: start the query right before `a = 1 AND b &gt; 2 AND __name__ &gt; /k/123`. - `START AFTER (10)`: start the query right after `a = 1 AND b &gt; 10`. Unlike `OFFSET` which requires scanning over the first N results to skip, a start cursor allows the query to begin at a logical position. This position is not required to match an actual result, it will scan forward from this position to find the next document. Requires: * The number of values cannot be greater than the number of fields specified in the `ORDER BY` clause.
3338 &quot;before&quot;: True or False, # If the position is just before or just after the given values, relative to the sort order defined by the query.
3339 &quot;values&quot;: [ # The values that represent a position, in the order they appear in the order by clause of a query. Can contain fewer values than specified in the order by clause.
3340 { # A message that can hold any of the supported value types.
3341 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
3342 &quot;values&quot;: [ # Values in the array.
3343 # Object with schema name: Value
3344 ],
3345 },
3346 &quot;booleanValue&quot;: True or False, # A boolean value.
3347 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
3348 &quot;doubleValue&quot;: 3.14, # A double value.
3349 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
3350 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
3351 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
3352 # Object with schema name: Value
3353 ],
3354 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3355 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3356 &quot;a_key&quot;: # Object with schema name: Value
3357 },
3358 },
3359 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
3360 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
3361 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
3362 },
3363 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
3364 &quot;mapValue&quot;: { # A map value. # A map value.
3365 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
3366 &quot;a_key&quot;: # Object with schema name: Value
3367 },
3368 },
3369 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
3370 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
3371 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
3372 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
3373 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
3374 # Object with schema name: Value
3375 ],
3376 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3377 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3378 &quot;a_key&quot;: # Object with schema name: Value
3379 },
3380 },
3381 ],
3382 },
3383 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
3384 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
3385 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
3386 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
3387 },
3388 ],
3389 },
3390 &quot;where&quot;: { # A filter. # The filter to apply.
3391 &quot;compositeFilter&quot;: { # A filter that merges multiple other filters using the given operator. # A composite filter.
3392 &quot;filters&quot;: [ # The list of filters to combine. Requires: * At least one filter is present.
3393 # Object with schema name: Filter
3394 ],
3395 &quot;op&quot;: &quot;A String&quot;, # The operator for combining multiple filters.
3396 },
3397 &quot;fieldFilter&quot;: { # A filter on a specific field. # A filter on a document field.
3398 &quot;field&quot;: { # A reference to a field in a document, ex: `stats.operations`. # The field to filter by.
3399 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
3400 },
3401 &quot;op&quot;: &quot;A String&quot;, # The operator to filter by.
3402 &quot;value&quot;: { # A message that can hold any of the supported value types. # The value to compare to.
3403 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
3404 &quot;values&quot;: [ # Values in the array.
3405 # Object with schema name: Value
3406 ],
3407 },
3408 &quot;booleanValue&quot;: True or False, # A boolean value.
3409 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
3410 &quot;doubleValue&quot;: 3.14, # A double value.
3411 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
3412 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
3413 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
3414 # Object with schema name: Value
3415 ],
3416 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3417 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3418 &quot;a_key&quot;: # Object with schema name: Value
3419 },
3420 },
3421 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
3422 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
3423 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
3424 },
3425 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
3426 &quot;mapValue&quot;: { # A map value. # A map value.
3427 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
3428 &quot;a_key&quot;: # Object with schema name: Value
3429 },
3430 },
3431 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
3432 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
3433 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
3434 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
3435 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
3436 # Object with schema name: Value
3437 ],
3438 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3439 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3440 &quot;a_key&quot;: # Object with schema name: Value
3441 },
3442 },
3443 ],
3444 },
3445 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
3446 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
3447 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
3448 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
3449 },
3450 },
3451 &quot;unaryFilter&quot;: { # A filter with a single operand. # A filter that takes exactly one argument.
3452 &quot;field&quot;: { # A reference to a field in a document, ex: `stats.operations`. # The field to which to apply the operator.
3453 &quot;fieldPath&quot;: &quot;A String&quot;, # A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
3454 },
3455 &quot;op&quot;: &quot;A String&quot;, # The unary operator to apply.
3456 },
3457 },
3458 },
3459 &quot;transaction&quot;: &quot;A String&quot;, # Run the query within an already active transaction. The value here is the opaque transaction ID to execute the query in.
3460 }
3461
3462 x__xgafv: string, V1 error format.
3463 Allowed values
3464 1 - v1 error format
3465 2 - v2 error format
3466
3467 Returns:
3468 An object of the form:
3469
3470 { # The response for Firestore.RunQuery.
3471 &quot;document&quot;: { # A Firestore document. Must not exceed 1 MiB - 4 bytes. # A query result, not set when reporting partial progress.
3472 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was created. This value increases monotonically when a document is deleted then recreated. It can also be compared to values from other documents and the `read_time` of a query.
3473 &quot;fields&quot;: { # The document&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The field names, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. Field paths may be used in other contexts to refer to structured fields defined here. For `map_value`, the field path is represented by a dot-delimited (`.`) string of segments. Each segment is either a simple field name (defined below) or a quoted field name. For example, the structured field `&quot;foo&quot; : { map_value: { &quot;x&amp;y&quot; : { string_value: &quot;hello&quot; }}}` would be represented by the field path `` foo.`x&amp;y` ``. A simple field name contains only characters `a` to `z`, `A` to `Z`, `0` to `9`, or `_`, and must not start with `0` to `9`. For example, `foo_bar_17`. A quoted field name starts and ends with `` ` `` and may contain any character. Some characters, including `` ` ``, must be escaped using a `\`. For example, `` `x&amp;y` `` represents `x&amp;y` and `` `bak\`tik` `` represents `` bak`tik ``.
3474 &quot;a_key&quot;: { # A message that can hold any of the supported value types.
3475 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
3476 &quot;values&quot;: [ # Values in the array.
3477 # Object with schema name: Value
3478 ],
3479 },
3480 &quot;booleanValue&quot;: True or False, # A boolean value.
3481 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
3482 &quot;doubleValue&quot;: 3.14, # A double value.
3483 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
3484 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
3485 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
3486 # Object with schema name: Value
3487 ],
3488 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3489 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3490 &quot;a_key&quot;: # Object with schema name: Value
3491 },
3492 },
3493 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
3494 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
3495 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
3496 },
3497 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
3498 &quot;mapValue&quot;: { # A map value. # A map value.
3499 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
3500 &quot;a_key&quot;: # Object with schema name: Value
3501 },
3502 },
3503 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
3504 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
3505 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
3506 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
3507 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
3508 # Object with schema name: Value
3509 ],
3510 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3511 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3512 &quot;a_key&quot;: # Object with schema name: Value
3513 },
3514 },
3515 ],
3516 },
3517 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
3518 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
3519 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
3520 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
3521 },
3522 },
3523 &quot;name&quot;: &quot;A String&quot;, # The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
3524 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was last changed. This value is initially set to the `create_time` then increases monotonically with each change to the document. It can also be compared to values from other documents and the `read_time` of a query.
3525 },
3526 &quot;done&quot;: True or False, # If present, Firestore has completely finished the request and no more documents will be returned.
3527 &quot;explainMetrics&quot;: { # Explain metrics for the query. # Query explain metrics. This is only present when the RunQueryRequest.explain_options is provided, and it is sent only once with the last response in the stream.
3528 &quot;executionStats&quot;: { # Execution statistics for the query. # Aggregated stats from the execution of the query. Only present when ExplainOptions.analyze is set to true.
3529 &quot;debugStats&quot;: { # Debugging statistics from the execution of the query. Note that the debugging stats are subject to change as Firestore evolves. It could include: { &quot;indexes_entries_scanned&quot;: &quot;1000&quot;, &quot;documents_scanned&quot;: &quot;20&quot;, &quot;billing_details&quot; : { &quot;documents_billable&quot;: &quot;20&quot;, &quot;index_entries_billable&quot;: &quot;1000&quot;, &quot;min_query_cost&quot;: &quot;0&quot; } }
3530 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
3531 },
3532 &quot;executionDuration&quot;: &quot;A String&quot;, # Total time to execute the query in the backend.
3533 &quot;readOperations&quot;: &quot;A String&quot;, # Total billable read operations.
3534 &quot;resultsReturned&quot;: &quot;A String&quot;, # Total number of results returned, including documents, projections, aggregation results, keys.
3535 },
3536 &quot;planSummary&quot;: { # Planning phase information for the query. # Planning phase information for the query.
3537 &quot;indexesUsed&quot;: [ # The indexes selected for the query. For example: [ {&quot;query_scope&quot;: &quot;Collection&quot;, &quot;properties&quot;: &quot;(foo ASC, __name__ ASC)&quot;}, {&quot;query_scope&quot;: &quot;Collection&quot;, &quot;properties&quot;: &quot;(bar ASC, __name__ ASC)&quot;} ]
3538 {
3539 &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
3540 },
3541 ],
3542 },
3543 },
3544 &quot;readTime&quot;: &quot;A String&quot;, # The time at which the document was read. This may be monotonically increasing; in this case, the previous documents in the result stream are guaranteed not to have changed between their `read_time` and this one. If the query returns no results, a response with `read_time` and no `document` will be sent, and this represents the time at which the query was run.
3545 &quot;skippedResults&quot;: 42, # The number of results that have been skipped due to an offset between the last response and the current response.
3546 &quot;transaction&quot;: &quot;A String&quot;, # The transaction that was started as part of this request. Can only be set in the first response, and only if RunQueryRequest.new_transaction was set in the request. If set, no other fields will be set in this response.
3547 }</pre>
3548 </div>
3549
3550 <div class="method">
3551 <code class="details" id="write">write(database, body=None, x__xgafv=None)</code>
3552 <pre>Streams batches of document updates and deletes, in order. This method is only available via gRPC or WebChannel (not REST).
3553
3554 Args:
3555 database: string, Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. This is only required in the first message. (required)
3556 body: object, The request body.
3557 The object takes the form of:
3558
3559 { # The request for Firestore.Write. The first request creates a stream, or resumes an existing one from a token. When creating a new stream, the server replies with a response containing only an ID and a token, to use in the next request. When resuming a stream, the server first streams any responses later than the given token, then a response containing only an up-to-date token, to use in the next request.
3560 &quot;labels&quot;: { # Labels associated with this write request.
3561 &quot;a_key&quot;: &quot;A String&quot;,
3562 },
3563 &quot;streamId&quot;: &quot;A String&quot;, # The ID of the write stream to resume. This may only be set in the first message. When left empty, a new write stream will be created.
3564 &quot;streamToken&quot;: &quot;A String&quot;, # A stream token that was previously sent by the server. The client should set this field to the token from the most recent WriteResponse it has received. This acknowledges that the client has received responses up to this token. After sending this token, earlier tokens may not be used anymore. The server may close the stream if there are too many unacknowledged responses. Leave this field unset when creating a new stream. To resume a stream at a specific point, set this field and the `stream_id` field. Leave this field unset when creating a new stream.
3565 &quot;writes&quot;: [ # The writes to apply. Always executed atomically and in order. This must be empty on the first request. This may be empty on the last request. This must not be empty on all other requests.
3566 { # A write on a document.
3567 &quot;currentDocument&quot;: { # A precondition on a document, used for conditional operations. # An optional precondition on the document. The write will fail if this is set and not met by the target document.
3568 &quot;exists&quot;: True or False, # When set to `true`, the target document must exist. When set to `false`, the target document must not exist.
3569 &quot;updateTime&quot;: &quot;A String&quot;, # When set, the target document must exist and have been last updated at that time. Timestamp must be microsecond aligned.
3570 },
3571 &quot;delete&quot;: &quot;A String&quot;, # A document name to delete. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
3572 &quot;transform&quot;: { # A transformation of a document. # Applies a transformation to a document.
3573 &quot;document&quot;: &quot;A String&quot;, # The name of the document to transform.
3574 &quot;fieldTransforms&quot;: [ # The list of transformations to apply to the fields of the document, in order. This must not be empty.
3575 { # A transformation of a field of the document.
3576 &quot;appendMissingElements&quot;: { # An array value. # Append the given elements in order if they are not already present in the current field value. If the field is not an array, or if the field does not yet exist, it is first set to the empty array. Equivalent numbers of different types (e.g. 3L and 3.0) are considered equal when checking if a value is missing. NaN is equal to NaN, and Null is equal to Null. If the input contains multiple equivalent values, only the first will be considered. The corresponding transform_result will be the null value.
3577 &quot;values&quot;: [ # Values in the array.
3578 # Object with schema name: Value
3579 ],
3580 },
3581 &quot;fieldPath&quot;: &quot;A String&quot;, # The path of the field. See Document.fields for the field path syntax reference.
3582 &quot;increment&quot;: { # A message that can hold any of the supported value types. # Adds the given value to the field&#x27;s current value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the given value. If either of the given value or the current field value are doubles, both values will be interpreted as doubles. Double arithmetic and representation of double values follow IEEE 754 semantics. If there is positive/negative integer overflow, the field is resolved to the largest magnitude positive/negative integer.
3583 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
3584 &quot;values&quot;: [ # Values in the array.
3585 # Object with schema name: Value
3586 ],
3587 },
3588 &quot;booleanValue&quot;: True or False, # A boolean value.
3589 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
3590 &quot;doubleValue&quot;: 3.14, # A double value.
3591 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
3592 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
3593 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
3594 # Object with schema name: Value
3595 ],
3596 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3597 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3598 &quot;a_key&quot;: # Object with schema name: Value
3599 },
3600 },
3601 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
3602 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
3603 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
3604 },
3605 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
3606 &quot;mapValue&quot;: { # A map value. # A map value.
3607 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
3608 &quot;a_key&quot;: # Object with schema name: Value
3609 },
3610 },
3611 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
3612 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
3613 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
3614 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
3615 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
3616 # Object with schema name: Value
3617 ],
3618 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3619 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3620 &quot;a_key&quot;: # Object with schema name: Value
3621 },
3622 },
3623 ],
3624 },
3625 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
3626 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
3627 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
3628 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
3629 },
3630 &quot;maximum&quot;: { # A message that can hold any of the supported value types. # Sets the field to the maximum of its current value and the given value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the given value. If a maximum operation is applied where the field and the input value are of mixed types (that is - one is an integer and one is a double) the field takes on the type of the larger operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not change. 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and zero input value is always the stored value. The maximum of any numeric value x and NaN is NaN.
3631 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
3632 &quot;values&quot;: [ # Values in the array.
3633 # Object with schema name: Value
3634 ],
3635 },
3636 &quot;booleanValue&quot;: True or False, # A boolean value.
3637 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
3638 &quot;doubleValue&quot;: 3.14, # A double value.
3639 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
3640 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
3641 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
3642 # Object with schema name: Value
3643 ],
3644 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3645 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3646 &quot;a_key&quot;: # Object with schema name: Value
3647 },
3648 },
3649 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
3650 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
3651 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
3652 },
3653 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
3654 &quot;mapValue&quot;: { # A map value. # A map value.
3655 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
3656 &quot;a_key&quot;: # Object with schema name: Value
3657 },
3658 },
3659 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
3660 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
3661 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
3662 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
3663 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
3664 # Object with schema name: Value
3665 ],
3666 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3667 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3668 &quot;a_key&quot;: # Object with schema name: Value
3669 },
3670 },
3671 ],
3672 },
3673 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
3674 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
3675 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
3676 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
3677 },
3678 &quot;minimum&quot;: { # A message that can hold any of the supported value types. # Sets the field to the minimum of its current value and the given value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the input value. If a minimum operation is applied where the field and the input value are of mixed types (that is - one is an integer and one is a double) the field takes on the type of the smaller operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not change. 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and zero input value is always the stored value. The minimum of any numeric value x and NaN is NaN.
3679 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
3680 &quot;values&quot;: [ # Values in the array.
3681 # Object with schema name: Value
3682 ],
3683 },
3684 &quot;booleanValue&quot;: True or False, # A boolean value.
3685 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
3686 &quot;doubleValue&quot;: 3.14, # A double value.
3687 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
3688 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
3689 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
3690 # Object with schema name: Value
3691 ],
3692 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3693 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3694 &quot;a_key&quot;: # Object with schema name: Value
3695 },
3696 },
3697 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
3698 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
3699 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
3700 },
3701 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
3702 &quot;mapValue&quot;: { # A map value. # A map value.
3703 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
3704 &quot;a_key&quot;: # Object with schema name: Value
3705 },
3706 },
3707 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
3708 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
3709 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
3710 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
3711 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
3712 # Object with schema name: Value
3713 ],
3714 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3715 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3716 &quot;a_key&quot;: # Object with schema name: Value
3717 },
3718 },
3719 ],
3720 },
3721 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
3722 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
3723 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
3724 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
3725 },
3726 &quot;removeAllFromArray&quot;: { # An array value. # Remove all of the given elements from the array in the field. If the field is not an array, or if the field does not yet exist, it is set to the empty array. Equivalent numbers of the different types (e.g. 3L and 3.0) are considered equal when deciding whether an element should be removed. NaN is equal to NaN, and Null is equal to Null. This will remove all equivalent values if there are duplicates. The corresponding transform_result will be the null value.
3727 &quot;values&quot;: [ # Values in the array.
3728 # Object with schema name: Value
3729 ],
3730 },
3731 &quot;setToServerValue&quot;: &quot;A String&quot;, # Sets the field to the given server value.
3732 },
3733 ],
3734 },
3735 &quot;update&quot;: { # A Firestore document. Must not exceed 1 MiB - 4 bytes. # A document to write.
3736 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was created. This value increases monotonically when a document is deleted then recreated. It can also be compared to values from other documents and the `read_time` of a query.
3737 &quot;fields&quot;: { # The document&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The field names, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. Field paths may be used in other contexts to refer to structured fields defined here. For `map_value`, the field path is represented by a dot-delimited (`.`) string of segments. Each segment is either a simple field name (defined below) or a quoted field name. For example, the structured field `&quot;foo&quot; : { map_value: { &quot;x&amp;y&quot; : { string_value: &quot;hello&quot; }}}` would be represented by the field path `` foo.`x&amp;y` ``. A simple field name contains only characters `a` to `z`, `A` to `Z`, `0` to `9`, or `_`, and must not start with `0` to `9`. For example, `foo_bar_17`. A quoted field name starts and ends with `` ` `` and may contain any character. Some characters, including `` ` ``, must be escaped using a `\`. For example, `` `x&amp;y` `` represents `x&amp;y` and `` `bak\`tik` `` represents `` bak`tik ``.
3738 &quot;a_key&quot;: { # A message that can hold any of the supported value types.
3739 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
3740 &quot;values&quot;: [ # Values in the array.
3741 # Object with schema name: Value
3742 ],
3743 },
3744 &quot;booleanValue&quot;: True or False, # A boolean value.
3745 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
3746 &quot;doubleValue&quot;: 3.14, # A double value.
3747 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
3748 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
3749 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
3750 # Object with schema name: Value
3751 ],
3752 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3753 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3754 &quot;a_key&quot;: # Object with schema name: Value
3755 },
3756 },
3757 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
3758 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
3759 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
3760 },
3761 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
3762 &quot;mapValue&quot;: { # A map value. # A map value.
3763 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
3764 &quot;a_key&quot;: # Object with schema name: Value
3765 },
3766 },
3767 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
3768 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
3769 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
3770 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
3771 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
3772 # Object with schema name: Value
3773 ],
3774 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3775 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3776 &quot;a_key&quot;: # Object with schema name: Value
3777 },
3778 },
3779 ],
3780 },
3781 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
3782 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
3783 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
3784 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
3785 },
3786 },
3787 &quot;name&quot;: &quot;A String&quot;, # The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
3788 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. The time at which the document was last changed. This value is initially set to the `create_time` then increases monotonically with each change to the document. It can also be compared to values from other documents and the `read_time` of a query.
3789 },
3790 &quot;updateMask&quot;: { # A set of field paths on a document. Used to restrict a get or update operation on a document to a subset of its fields. This is different from standard field masks, as this is always scoped to a Document, and takes in account the dynamic nature of Value. # The fields to update in this write. This field can be set only when the operation is `update`. If the mask is not set for an `update` and the document exists, any existing data will be overwritten. If the mask is set and the document on the server has fields not covered by the mask, they are left unchanged. Fields referenced in the mask, but not present in the input document, are deleted from the document on the server. The field paths in this mask must not contain a reserved field name.
3791 &quot;fieldPaths&quot;: [ # The list of field paths in the mask. See Document.fields for a field path syntax reference.
3792 &quot;A String&quot;,
3793 ],
3794 },
3795 &quot;updateTransforms&quot;: [ # The transforms to perform after update. This field can be set only when the operation is `update`. If present, this write is equivalent to performing `update` and `transform` to the same document atomically and in order.
3796 { # A transformation of a field of the document.
3797 &quot;appendMissingElements&quot;: { # An array value. # Append the given elements in order if they are not already present in the current field value. If the field is not an array, or if the field does not yet exist, it is first set to the empty array. Equivalent numbers of different types (e.g. 3L and 3.0) are considered equal when checking if a value is missing. NaN is equal to NaN, and Null is equal to Null. If the input contains multiple equivalent values, only the first will be considered. The corresponding transform_result will be the null value.
3798 &quot;values&quot;: [ # Values in the array.
3799 # Object with schema name: Value
3800 ],
3801 },
3802 &quot;fieldPath&quot;: &quot;A String&quot;, # The path of the field. See Document.fields for the field path syntax reference.
3803 &quot;increment&quot;: { # A message that can hold any of the supported value types. # Adds the given value to the field&#x27;s current value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the given value. If either of the given value or the current field value are doubles, both values will be interpreted as doubles. Double arithmetic and representation of double values follow IEEE 754 semantics. If there is positive/negative integer overflow, the field is resolved to the largest magnitude positive/negative integer.
3804 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
3805 &quot;values&quot;: [ # Values in the array.
3806 # Object with schema name: Value
3807 ],
3808 },
3809 &quot;booleanValue&quot;: True or False, # A boolean value.
3810 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
3811 &quot;doubleValue&quot;: 3.14, # A double value.
3812 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
3813 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
3814 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
3815 # Object with schema name: Value
3816 ],
3817 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3818 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3819 &quot;a_key&quot;: # Object with schema name: Value
3820 },
3821 },
3822 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
3823 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
3824 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
3825 },
3826 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
3827 &quot;mapValue&quot;: { # A map value. # A map value.
3828 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
3829 &quot;a_key&quot;: # Object with schema name: Value
3830 },
3831 },
3832 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
3833 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
3834 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
3835 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
3836 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
3837 # Object with schema name: Value
3838 ],
3839 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3840 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3841 &quot;a_key&quot;: # Object with schema name: Value
3842 },
3843 },
3844 ],
3845 },
3846 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
3847 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
3848 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
3849 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
3850 },
3851 &quot;maximum&quot;: { # A message that can hold any of the supported value types. # Sets the field to the maximum of its current value and the given value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the given value. If a maximum operation is applied where the field and the input value are of mixed types (that is - one is an integer and one is a double) the field takes on the type of the larger operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not change. 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and zero input value is always the stored value. The maximum of any numeric value x and NaN is NaN.
3852 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
3853 &quot;values&quot;: [ # Values in the array.
3854 # Object with schema name: Value
3855 ],
3856 },
3857 &quot;booleanValue&quot;: True or False, # A boolean value.
3858 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
3859 &quot;doubleValue&quot;: 3.14, # A double value.
3860 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
3861 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
3862 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
3863 # Object with schema name: Value
3864 ],
3865 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3866 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3867 &quot;a_key&quot;: # Object with schema name: Value
3868 },
3869 },
3870 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
3871 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
3872 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
3873 },
3874 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
3875 &quot;mapValue&quot;: { # A map value. # A map value.
3876 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
3877 &quot;a_key&quot;: # Object with schema name: Value
3878 },
3879 },
3880 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
3881 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
3882 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
3883 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
3884 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
3885 # Object with schema name: Value
3886 ],
3887 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3888 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3889 &quot;a_key&quot;: # Object with schema name: Value
3890 },
3891 },
3892 ],
3893 },
3894 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
3895 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
3896 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
3897 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
3898 },
3899 &quot;minimum&quot;: { # A message that can hold any of the supported value types. # Sets the field to the minimum of its current value and the given value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the input value. If a minimum operation is applied where the field and the input value are of mixed types (that is - one is an integer and one is a double) the field takes on the type of the smaller operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not change. 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and zero input value is always the stored value. The minimum of any numeric value x and NaN is NaN.
3900 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
3901 &quot;values&quot;: [ # Values in the array.
3902 # Object with schema name: Value
3903 ],
3904 },
3905 &quot;booleanValue&quot;: True or False, # A boolean value.
3906 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
3907 &quot;doubleValue&quot;: 3.14, # A double value.
3908 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
3909 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
3910 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
3911 # Object with schema name: Value
3912 ],
3913 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3914 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3915 &quot;a_key&quot;: # Object with schema name: Value
3916 },
3917 },
3918 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
3919 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
3920 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
3921 },
3922 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
3923 &quot;mapValue&quot;: { # A map value. # A map value.
3924 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
3925 &quot;a_key&quot;: # Object with schema name: Value
3926 },
3927 },
3928 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
3929 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
3930 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
3931 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
3932 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
3933 # Object with schema name: Value
3934 ],
3935 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3936 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3937 &quot;a_key&quot;: # Object with schema name: Value
3938 },
3939 },
3940 ],
3941 },
3942 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
3943 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
3944 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
3945 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
3946 },
3947 &quot;removeAllFromArray&quot;: { # An array value. # Remove all of the given elements from the array in the field. If the field is not an array, or if the field does not yet exist, it is set to the empty array. Equivalent numbers of the different types (e.g. 3L and 3.0) are considered equal when deciding whether an element should be removed. NaN is equal to NaN, and Null is equal to Null. This will remove all equivalent values if there are duplicates. The corresponding transform_result will be the null value.
3948 &quot;values&quot;: [ # Values in the array.
3949 # Object with schema name: Value
3950 ],
3951 },
3952 &quot;setToServerValue&quot;: &quot;A String&quot;, # Sets the field to the given server value.
3953 },
3954 ],
3955 },
3956 ],
3957 }
3958
3959 x__xgafv: string, V1 error format.
3960 Allowed values
3961 1 - v1 error format
3962 2 - v2 error format
3963
3964 Returns:
3965 An object of the form:
3966
3967 { # The response for Firestore.Write.
3968 &quot;commitTime&quot;: &quot;A String&quot;, # The time at which the commit occurred. Any read with an equal or greater `read_time` is guaranteed to see the effects of the write.
3969 &quot;streamId&quot;: &quot;A String&quot;, # The ID of the stream. Only set on the first message, when a new stream was created.
3970 &quot;streamToken&quot;: &quot;A String&quot;, # A token that represents the position of this response in the stream. This can be used by a client to resume the stream at this point. This field is always set.
3971 &quot;writeResults&quot;: [ # The result of applying the writes. This i-th write result corresponds to the i-th write in the request.
3972 { # The result of applying a write.
3973 &quot;transformResults&quot;: [ # The results of applying each DocumentTransform.FieldTransform, in the same order.
3974 { # A message that can hold any of the supported value types.
3975 &quot;arrayValue&quot;: { # An array value. # An array value. Cannot directly contain another array value, though can contain a map which contains another array.
3976 &quot;values&quot;: [ # Values in the array.
3977 # Object with schema name: Value
3978 ],
3979 },
3980 &quot;booleanValue&quot;: True or False, # A boolean value.
3981 &quot;bytesValue&quot;: &quot;A String&quot;, # A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries.
3982 &quot;doubleValue&quot;: 3.14, # A double value.
3983 &quot;fieldReferenceValue&quot;: &quot;A String&quot;, # Value which references a field. This is considered relative (vs absolute) since it only refers to a field and not a field within a particular document. **Requires:** * Must follow field reference limitations. * Not allowed to be used when writing documents.
3984 &quot;functionValue&quot;: { # Represents an unevaluated scalar expression. For example, the expression `like(user_name, &quot;%alice%&quot;)` is represented as: ``` name: &quot;like&quot; args { field_reference: &quot;user_name&quot; } args { string_value: &quot;%alice%&quot; } ``` # A value that represents an unevaluated expression. **Requires:** * Not allowed to be used when writing documents.
3985 &quot;args&quot;: [ # Optional. Ordered list of arguments the given function expects.
3986 # Object with schema name: Value
3987 ],
3988 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
3989 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
3990 &quot;a_key&quot;: # Object with schema name: Value
3991 },
3992 },
3993 &quot;geoPointValue&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # A geo point value representing a point on the surface of Earth.
3994 &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
3995 &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
3996 },
3997 &quot;integerValue&quot;: &quot;A String&quot;, # An integer value.
3998 &quot;mapValue&quot;: { # A map value. # A map value.
3999 &quot;fields&quot;: { # The map&#x27;s fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.
4000 &quot;a_key&quot;: # Object with schema name: Value
4001 },
4002 },
4003 &quot;nullValue&quot;: &quot;A String&quot;, # A null value.
4004 &quot;pipelineValue&quot;: { # A Firestore query represented as an ordered list of operations / stages. # A value that represents an unevaluated pipeline. **Requires:** * Not allowed to be used when writing documents.
4005 &quot;stages&quot;: [ # Required. Ordered list of stages to evaluate.
4006 { # A single operation within a pipeline. A stage is made up of a unique name, and a list of arguments. The exact number of arguments &amp; types is dependent on the stage type. To give an example, the stage `filter(state = &quot;MD&quot;)` would be encoded as: ``` name: &quot;filter&quot; args { function_value { name: &quot;eq&quot; args { field_reference_value: &quot;state&quot; } args { string_value: &quot;MD&quot; } } } ``` See public documentation for the full list.
4007 &quot;args&quot;: [ # Optional. Ordered list of arguments the given stage expects.
4008 # Object with schema name: Value
4009 ],
4010 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the stage to evaluate. **Requires:** * must be in snake case (lower case with underscore separator).
4011 &quot;options&quot;: { # Optional. Optional named arguments that certain functions may support.
4012 &quot;a_key&quot;: # Object with schema name: Value
4013 },
4014 },
4015 ],
4016 },
4017 &quot;referenceValue&quot;: &quot;A String&quot;, # A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
4018 &quot;stringValue&quot;: &quot;A String&quot;, # A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries.
4019 &quot;timestampValue&quot;: &quot;A String&quot;, # A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down.
4020 &quot;variableReferenceValue&quot;: &quot;A String&quot;, # Pointer to a variable defined elsewhere in a pipeline. Unlike `field_reference_value` which references a field within a document, this refers to a variable, defined in a separate namespace than the fields of a document.
4021 },
4022 ],
4023 &quot;updateTime&quot;: &quot;A String&quot;, # The last update time of the document after applying the write. Not set after a `delete`. If the write did not actually change the document, this will be the previous update_time.
4024 },
4025 ],
4026 }</pre>
4027 </div>
4028
4029 </body></html>