google.firestore. v1
Enumerations
Direction
number
A sort direction.
Value |
|
---|---|
DIRECTION_UNSPECIFIED |
Unspecified. |
ASCENDING |
Ascending. |
DESCENDING |
Descending. |
Operator
number
A field filter operator.
Value |
|
---|---|
OPERATOR_UNSPECIFIED |
Unspecified. This value must not be used. |
LESS_THAN |
Less than. Requires that the field come first in |
LESS_THAN_OR_EQUAL |
Less than or equal. Requires that the field come first in |
GREATER_THAN |
Greater than. Requires that the field come first in |
GREATER_THAN_OR_EQUAL |
Greater than or equal. Requires that the field come first in
|
EQUAL |
Equal. |
ARRAY_CONTAINS |
Contains. Requires that the field is an array. |
Operator
number
A unary operator.
Value |
|
---|---|
OPERATOR_UNSPECIFIED |
Unspecified. This value must not be used. |
IS_NAN |
Test if a field is equal to NaN. |
IS_NULL |
Test if an exprestion evaluates to Null. |
Operator
number
A composite filter operator.
Value |
|
---|---|
OPERATOR_UNSPECIFIED |
Unspecified. This value must not be used. |
AND |
The results are required to satisfy each of the combined filters. |
ServerValue
number
A value that is calculated by the server.
Value |
|
---|---|
SERVER_VALUE_UNSPECIFIED |
Unspecified. This value must not be used. |
REQUEST_TIME |
The time at which the server processed the request, with millisecond precision. |
TargetChangeType
number
The type of change.
Value |
|
---|---|
NO_CHANGE |
No change has occurred. Used only to send an updated |
ADD |
The targets have been added. |
REMOVE |
The targets have been removed. |
CURRENT |
The targets reflect all changes committed before the targets were added to the stream. This will be sent after or with a Listeners can wait for this change if read-after-write semantics are desired. |
RESET |
The targets have been reset, and a new initial state for the targets will be returned in subsequent changes. After the initial state is complete, |
Properties
Direction
number
A sort direction.
Value |
|
---|---|
DIRECTION_UNSPECIFIED |
Unspecified. |
ASCENDING |
Ascending. |
DESCENDING |
Descending. |
Operator
number
A field filter operator.
Value |
|
---|---|
OPERATOR_UNSPECIFIED |
Unspecified. This value must not be used. |
LESS_THAN |
Less than. Requires that the field come first in |
LESS_THAN_OR_EQUAL |
Less than or equal. Requires that the field come first in |
GREATER_THAN |
Greater than. Requires that the field come first in |
GREATER_THAN_OR_EQUAL |
Greater than or equal. Requires that the field come first in
|
EQUAL |
Equal. |
ARRAY_CONTAINS |
Contains. Requires that the field is an array. |
Operator
number
A unary operator.
Value |
|
---|---|
OPERATOR_UNSPECIFIED |
Unspecified. This value must not be used. |
IS_NAN |
Test if a field is equal to NaN. |
IS_NULL |
Test if an exprestion evaluates to Null. |
Operator
number
A composite filter operator.
Value |
|
---|---|
OPERATOR_UNSPECIFIED |
Unspecified. This value must not be used. |
AND |
The results are required to satisfy each of the combined filters. |
ServerValue
number
A value that is calculated by the server.
Value |
|
---|---|
SERVER_VALUE_UNSPECIFIED |
Unspecified. This value must not be used. |
REQUEST_TIME |
The time at which the server processed the request, with millisecond precision. |
TargetChangeType
number
The type of change.
Value |
|
---|---|
NO_CHANGE |
No change has occurred. Used only to send an updated |
ADD |
The targets have been added. |
REMOVE |
The targets have been removed. |
CURRENT |
The targets reflect all changes committed before the targets were added to the stream. This will be sent after or with a Listeners can wait for this change if read-after-write semantics are desired. |
RESET |
The targets have been reset, and a new initial state for the targets will be returned in subsequent changes. After the initial state is complete, |
Abstract types
ArrayValue
An array value.
Property
Parameter |
|
---|---|
values |
Array of Object Values in the array. This object should have the same structure as Value |
BatchGetDocumentsRequest
The request for Firestore.BatchGetDocuments.
Properties
Parameter |
|
---|---|
database |
string The database name. In the format:
|
documents |
Array of string The names of the documents to retrieve. In the format:
|
mask |
Object 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. This object should have the same structure as DocumentMask |
transaction |
string Reads documents in a transaction. |
newTransaction |
Object 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. This object should have the same structure as TransactionOptions |
readTime |
Object Reads documents as they were at the given time. This may not be older than 60 seconds. This object should have the same structure as Timestamp |
BatchGetDocumentsResponse
The streamed response for Firestore.BatchGetDocuments.
Properties
Parameter |
|
---|---|
found |
Object A document that was requested. This object should have the same structure as Document |
missing |
string A document name that was requested but does not exist. In the format:
|
transaction |
string 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. |
readTime |
Object 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. This object should have the same structure as Timestamp |
BeginTransactionRequest
The request for Firestore.BeginTransaction.
Properties
Parameter |
|
---|---|
database |
string The database name. In the format:
|
options |
Object The options for the transaction. Defaults to a read-write transaction. This object should have the same structure as TransactionOptions |
BeginTransactionResponse
The response for Firestore.BeginTransaction.
Property
Parameter |
|
---|---|
transaction |
string The transaction that was started. |
CollectionSelector
A selection of a collection, such as messages as m1
.
Properties
Parameter |
|
---|---|
collectionId |
string The collection ID. When set, selects only collections with this ID. |
allDescendants |
boolean When false, selects only collections that are immediate children of the |
CommitRequest
The request for Firestore.Commit.
Properties
Parameter |
|
---|---|
database |
string The database name. In the format:
|
writes |
Array of Object The writes to apply. Always executed atomically and in order. This object should have the same structure as Write |
transaction |
string If set, applies all writes in this transaction, and commits it. |
CommitResponse
The response for Firestore.Commit.
Properties
Parameter |
|
---|---|
writeResults |
Array of Object The result of applying the writes. This i-th write result corresponds to the i-th write in the request. This object should have the same structure as WriteResult |
commitTime |
Object The time at which the commit occurred. This object should have the same structure as Timestamp |
CompositeFilter
A filter that merges multiple other filters using the given operator.
Properties
Parameter |
|
---|---|
op |
number The operator for combining multiple filters. The number should be among the values of Operator |
filters |
Array of Object The list of filters to combine. Must contain at least one filter. This object should have the same structure as Filter |
CreateDocumentRequest
The request for Firestore.CreateDocument.
Properties
Parameter |
|
---|---|
parent |
string The parent resource. For example:
|
collectionId |
string The collection ID, relative to |
documentId |
string The client-assigned document ID to use for this document. Optional. If not specified, an ID will be assigned by the service. |
document |
Object The document to create. This object should have the same structure as Document |
mask |
Object The fields to return. If not set, returns all fields. If the document has a field that is not present in this mask, that field will not be returned in the response. This object should have the same structure as DocumentMask |
Cursor
A position in a query result set.
Properties
Parameter |
|
---|---|
values |
Array of Object 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. This object should have the same structure as Value |
before |
boolean If the position is just before or just after the given values, relative to the sort order defined by the query. |
DeleteDocumentRequest
The request for Firestore.DeleteDocument.
Properties
Parameter |
|
---|---|
name |
string The resource name of the Document to delete. In the format:
|
currentDocument |
Object An optional precondition on the document. The request will fail if this is set and not met by the target document. This object should have the same structure as Precondition |
Document
A Firestore document.
Must not exceed 1 MiB - 4 bytes.
Properties
Parameter |
|
---|---|
name |
string The resource name of the document, for example
|
fields |
Object with Object properties The document's fields. The map keys represent field names. A simple field name contains only characters Field names matching the regular expression Field paths may be used in other contexts to refer to structured fields defined here. For Within a field path, a quoted field name starts and ends with |
createTime |
Object 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 This object should have the same structure as Timestamp |
updateTime |
Object Output only. The time at which the document was last changed. This value is initially set to the This object should have the same structure as Timestamp |
DocumentChange
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.
Properties
Parameter |
|
---|---|
document |
Object The new state of the Document. If This object should have the same structure as Document |
targetIds |
Array of number A set of target IDs of targets that match this document. |
removedTargetIds |
Array of number A set of target IDs for targets that no longer match this document. |
DocumentDelete
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.
Properties
Parameter |
|
---|---|
document |
string The resource name of the Document that was deleted. |
removedTargetIds |
Array of number A set of target IDs for targets that previously matched this entity. |
readTime |
Object The read timestamp at which the delete was observed. Greater or equal to the This object should have the same structure as Timestamp |
DocumentMask
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.
Property
Parameter |
|
---|---|
fieldPaths |
Array of string The list of field paths in the mask. See Document.fields for a field path syntax reference. |
DocumentRemove
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.
Properties
Parameter |
|
---|---|
document |
string The resource name of the Document that has gone out of view. |
removedTargetIds |
Array of number A set of target IDs for targets that previously matched this document. |
readTime |
Object The read timestamp at which the remove was observed. Greater or equal to the This object should have the same structure as Timestamp |
DocumentsTarget
A target specified by a set of documents names.
Property
Parameter |
|
---|---|
documents |
Array of string The names of the documents to retrieve. In the format:
|
DocumentTransform
A transformation of a document.
Properties
Parameter |
|
---|---|
document |
string The name of the document to transform. |
fieldTransforms |
Array of Object The list of transformations to apply to the fields of the document, in order. This must not be empty. This object should have the same structure as FieldTransform |
ExistenceFilter
A digest of all the documents that match a given target.
Properties
Parameter |
|
---|---|
targetId |
number The target ID to which this filter applies. |
count |
number 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. |
FieldFilter
A filter on a specific field.
Properties
Parameter |
|
---|---|
field |
Object The field to filter by. This object should have the same structure as FieldReference |
op |
number The operator to filter by. The number should be among the values of Operator |
value |
Object The value to compare to. This object should have the same structure as Value |
FieldReference
A reference to a field, such as max(messages.time) as max_time
.
Property
Parameter |
|
---|---|
fieldPath |
string |
FieldTransform
A transformation of a field of the document.
Properties
Parameter |
|
---|---|
fieldPath |
string The path of the field. See Document.fields for the field path syntax reference. |
setToServerValue |
number Sets the field to the given server value. The number should be among the values of ServerValue |
increment |
Object Adds the given value to the field'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. This object should have the same structure as Value |
maximum |
Object 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. This object should have the same structure as Value |
minimum |
Object 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. This object should have the same structure as Value |
appendMissingElements |
Object 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. This object should have the same structure as ArrayValue |
removeAllFromArray |
Object 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. This object should have the same structure as ArrayValue |
Filter
A filter.
Properties
Parameter |
|
---|---|
compositeFilter |
Object A composite filter. This object should have the same structure as CompositeFilter |
fieldFilter |
Object A filter on a document field. This object should have the same structure as FieldFilter |
unaryFilter |
Object A filter that takes exactly one argument. This object should have the same structure as UnaryFilter |
GetDocumentRequest
The request for Firestore.GetDocument.
Properties
Parameter |
|
---|---|
name |
string The resource name of the Document to get. In the format:
|
mask |
Object The fields to return. If not set, returns all fields. If the document has a field that is not present in this mask, that field will not be returned in the response. This object should have the same structure as DocumentMask |
transaction |
string Reads the document in a transaction. |
readTime |
Object Reads the version of the document at the given time. This may not be older than 60 seconds. This object should have the same structure as Timestamp |
ListCollectionIdsRequest
The request for Firestore.ListCollectionIds.
Properties
Parameter |
|
---|---|
parent |
string The parent document. In the format:
|
pageSize |
number The maximum number of results to return. |
pageToken |
string A page token. Must be a value from ListCollectionIdsResponse. |
ListCollectionIdsResponse
The response from Firestore.ListCollectionIds.
Properties
Parameter |
|
---|---|
collectionIds |
Array of string The collection ids. |
nextPageToken |
string A page token that may be used to continue the list. |
ListDocumentsRequest
The request for Firestore.ListDocuments.
Properties
Parameter |
|
---|---|
parent |
string The parent resource name. In the format:
|
collectionId |
string The collection ID, relative to |
pageSize |
number The maximum number of documents to return. |
pageToken |
string The |
orderBy |
string The order to sort results by. For example: |
mask |
Object 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. This object should have the same structure as DocumentMask |
transaction |
string Reads documents in a transaction. |
readTime |
Object Reads documents as they were at the given time. This may not be older than 60 seconds. This object should have the same structure as Timestamp |
showMissing |
boolean If the list should show missing documents. A missing document is a document that does not exist but has sub-documents. These documents will be returned with a key but will not have fields, Document.create_time, or Document.update_time set. Requests with |
ListDocumentsResponse
The response for Firestore.ListDocuments.
Properties
Parameter |
|
---|---|
documents |
Array of Object The Documents found. This object should have the same structure as Document |
nextPageToken |
string The next page token. |
ListenRequest
A request for Firestore.Listen
Properties
Parameter |
|
---|---|
database |
string The database name. In the format:
|
addTarget |
Object A target to add to this stream. This object should have the same structure as Target |
removeTarget |
number The ID of a target to remove from this stream. |
labels |
Object with string properties Labels associated with this target change. |
ListenResponse
The response for Firestore.Listen.
Properties
Parameter |
|
---|---|
targetChange |
Object Targets have changed. This object should have the same structure as TargetChange |
documentChange |
Object A Document has changed. This object should have the same structure as DocumentChange |
documentDelete |
Object A Document has been deleted. This object should have the same structure as DocumentDelete |
documentRemove |
Object A Document has been removed from a target (because it is no longer relevant to that target). This object should have the same structure as DocumentRemove |
filter |
Object 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. This object should have the same structure as ExistenceFilter |
MapValue
A map value.
Property
Parameter |
|
---|---|
fields |
Object with Object properties The map's fields. The map keys represent field names. Field names matching the regular expression |
Order
An order on a field.
Properties
Parameter |
|
---|---|
field |
Object The field to order by. This object should have the same structure as FieldReference |
direction |
number The direction to order by. Defaults to The number should be among the values of Direction |
Precondition
A precondition on a document, used for conditional operations.
Properties
Parameter |
|
---|---|
exists |
boolean When set to |
updateTime |
Object When set, the target document must exist and have been last updated at that time. This object should have the same structure as Timestamp |
Projection
The projection of document's fields to return.
Property
Parameter |
|
---|---|
fields |
Array of Object The fields to return. If empty, all fields are returned. To only return the name of the document, use This object should have the same structure as FieldReference |
QueryTarget
A target specified by a query.
Properties
Parameter |
|
---|---|
parent |
string The parent resource name. In the format:
|
structuredQuery |
Object A structured query. This object should have the same structure as StructuredQuery |
ReadOnly
Options for a transaction that can only be used to read documents.
Property
Parameter |
|
---|---|
readTime |
Object Reads documents at the given time. This may not be older than 60 seconds. This object should have the same structure as Timestamp |
ReadWrite
Options for a transaction that can be used to read and write documents.
Property
Parameter |
|
---|---|
retryTransaction |
string An optional transaction to retry. |
RollbackRequest
The request for Firestore.Rollback.
Properties
Parameter |
|
---|---|
database |
string The database name. In the format:
|
transaction |
string The transaction to roll back. |
RunQueryRequest
The request for Firestore.RunQuery.
Properties
Parameter |
|
---|---|
parent |
string The parent resource name. In the format:
|
structuredQuery |
Object A structured query. This object should have the same structure as StructuredQuery |
transaction |
string Reads documents in a transaction. |
newTransaction |
Object 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. This object should have the same structure as TransactionOptions |
readTime |
Object Reads documents as they were at the given time. This may not be older than 60 seconds. This object should have the same structure as Timestamp |
RunQueryResponse
The response for Firestore.RunQuery.
Properties
Parameter |
|
---|---|
transaction |
string 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. |
document |
Object A query result. Not set when reporting partial progress. This object should have the same structure as Document |
readTime |
Object 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 If the query returns no results, a response with This object should have the same structure as Timestamp |
skippedResults |
number The number of results that have been skipped due to an offset between the last response and the current response. |
StructuredQuery
A Firestore query.
Properties
Parameter |
|
---|---|
select |
Object The projection to return. This object should have the same structure as Projection |
from |
Array of Object The collections to query. This object should have the same structure as CollectionSelector |
where |
Object The filter to apply. This object should have the same structure as Filter |
orderBy |
Array of Object
The order to apply to the query results.
Firestore guarantees a stable ordering through the following rules:
|
startAt |
Object A starting point for the query results. This object should have the same structure as Cursor |
endAt |
Object A end point for the query results. This object should have the same structure as Cursor |
offset |
number The number of results to skip. Applies before limit, but after all other constraints. Must be >= 0 if specified. |
limit |
Object The maximum number of results to return. Applies after all other constraints. Must be >= 0 if specified. This object should have the same structure as Int32Value |
Target
A specification of a set of documents to listen to.
Properties
Parameter |
|
---|---|
query |
Object A target specified by a query. This object should have the same structure as QueryTarget |
documents |
Object A target specified by a set of document names. This object should have the same structure as DocumentsTarget |
resumeToken |
string A resume token from a prior TargetChange for an identical target. Using a resume token with a different target is unsupported and may fail. |
readTime |
Object Start listening after a specific The client must know the state of matching documents at this time. This object should have the same structure as Timestamp |
targetId |
number A client provided target ID. If not set, the server will assign an ID for the target. Used for resuming a target without changing IDs. The IDs can either be client-assigned or be server-assigned in a previous stream. All targets with client provided IDs must be added before adding a target that needs a server-assigned id. |
once |
boolean If the target should be removed once it is current and consistent. |
TargetChange
Targets being watched have changed.
Properties
Parameter |
|
---|---|
targetChangeType |
number The type of change that occurred. The number should be among the values of TargetChangeType |
targetIds |
Array of number The target IDs of targets that have changed. If empty, the change applies to all targets. For For other states, the order of the target IDs is not defined. |
cause |
Object The error that resulted in this change, if applicable. This object should have the same structure as Status |
resumeToken |
string A token that can be used to resume the stream for the given Not set on every target change. |
readTime |
Object The consistent The stream is guaranteed to send a For a given stream, This object should have the same structure as Timestamp |
TransactionOptions
Options for creating a new transaction.
Properties
Parameter |
|
---|---|
readOnly |
Object The transaction can only be used for read operations. This object should have the same structure as ReadOnly |
readWrite |
Object The transaction can be used for both read and write operations. This object should have the same structure as ReadWrite |
UnaryFilter
A filter with a single operand.
Properties
Parameter |
|
---|---|
op |
number The unary operator to apply. The number should be among the values of Operator |
field |
Object The field to which to apply the operator. This object should have the same structure as FieldReference |
UpdateDocumentRequest
The request for Firestore.UpdateDocument.
Properties
Parameter |
|
---|---|
document |
Object The updated document. Creates the document if it does not already exist. This object should have the same structure as Document |
updateMask |
Object The fields to update. None of the field paths in the mask may contain a reserved name. If the document exists on the server and has fields not referenced in 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. This object should have the same structure as DocumentMask |
mask |
Object The fields to return. If not set, returns all fields. If the document has a field that is not present in this mask, that field will not be returned in the response. This object should have the same structure as DocumentMask |
currentDocument |
Object An optional precondition on the document. The request will fail if this is set and not met by the target document. This object should have the same structure as Precondition |
Value
A message that can hold any of the supported value types.
Properties
Parameter |
|
---|---|
nullValue |
number A null value. The number should be among the values of NullValue |
booleanValue |
boolean A boolean value. |
integerValue |
number An integer value. |
doubleValue |
number A double value. |
timestampValue |
Object A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down. This object should have the same structure as Timestamp |
stringValue |
string 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. |
bytesValue |
string A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries. |
referenceValue |
string A reference to a document. For example:
|
geoPointValue |
Object A geo point value representing a point on the surface of Earth. This object should have the same structure as LatLng |
arrayValue |
Object An array value. Cannot directly contain another array value, though can contain an map which contains another array. This object should have the same structure as ArrayValue |
mapValue |
Object A map value. This object should have the same structure as MapValue |
Write
A write on a document.
Properties
Parameter |
|
---|---|
update |
Object A document to write. This object should have the same structure as Document |
delete |
string A document name to delete. In the format:
|
transform |
Object Applies a transformation to a document. At most one This object should have the same structure as DocumentTransform |
updateMask |
Object The fields to update in this write. This field can be set only when the operation is This object should have the same structure as DocumentMask |
currentDocument |
Object An optional precondition on the document. The write will fail if this is set and not met by the target document. This object should have the same structure as Precondition |
WriteRequest
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.
Properties
Parameter |
|
---|---|
database |
string The database name. In the format:
|
streamId |
string 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. |
writes |
Array of Object 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. This object should have the same structure as Write |
streamToken |
string 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 Leave this field unset when creating a new stream. |
labels |
Object with string properties Labels associated with this write request. |
WriteResponse
The response for Firestore.Write.
Properties
Parameter |
|
---|---|
streamId |
string The ID of the stream. Only set on the first message, when a new stream was created. |
streamToken |
string 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. |
writeResults |
Array of Object The result of applying the writes. This i-th write result corresponds to the i-th write in the request. This object should have the same structure as WriteResult |
commitTime |
Object The time at which the commit occurred. This object should have the same structure as Timestamp |
WriteResult
The result of applying a write.
Properties
Parameter |
|
---|---|
updateTime |
Object The last update time of the document after applying the write. Not set after a If the write did not actually change the document, this will be the previous update_time. This object should have the same structure as Timestamp |
transformResults |
Array of Object The results of applying each DocumentTransform.FieldTransform, in the same order. This object should have the same structure as Value |