Abstract types

ArrayValue

static

An array value.

Property

Parameter

values

Array of Object

Values in the array.

This object should have the same structure as Value

See also

google.firestore.v1beta1.ArrayValue definition in proto format

BatchGetDocumentsRequest

static

The request for Firestore.BatchGetDocuments.

Properties

Parameter

database

string

The database name. In the format: projects/{project_id}/databases/{database_id}.

documents

Array of string

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.

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

See also

google.firestore.v1beta1.BatchGetDocumentsRequest definition in proto format

BatchGetDocumentsResponse

static

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: projects/{project_id}/databases/{database_id}/documents/{document_path}.

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

See also

google.firestore.v1beta1.BatchGetDocumentsResponse definition in proto format

BeginTransactionRequest

static

The request for Firestore.BeginTransaction.

Properties

Parameter

database

string

The database name. In the format: projects/{project_id}/databases/{database_id}.

options

Object

The options for the transaction. Defaults to a read-write transaction.

This object should have the same structure as TransactionOptions

See also

google.firestore.v1beta1.BeginTransactionRequest definition in proto format

BeginTransactionResponse

static

The response for Firestore.BeginTransaction.

Property

Parameter

transaction

string

The transaction that was started.

See also

google.firestore.v1beta1.BeginTransactionResponse definition in proto format

CollectionSelector

static

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 parent specified in the containing RunQueryRequest. When true, selects all descendant collections.

See also

google.firestore.v1beta1.StructuredQuery.CollectionSelector definition in proto format

CommitRequest

static

The request for Firestore.Commit.

Properties

Parameter

database

string

The database name. In the format: projects/{project_id}/databases/{database_id}.

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.

See also

google.firestore.v1beta1.CommitRequest definition in proto format

CommitResponse

static

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

See also

google.firestore.v1beta1.CommitResponse definition in proto format

CompositeFilter

static

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

See also

google.firestore.v1beta1.StructuredQuery.CompositeFilter definition in proto format

CreateDocumentRequest

static

The request for Firestore.CreateDocument.

Properties

Parameter

parent

string

The parent resource. For example: projects/{project_id}/databases/{database_id}/documents or projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}

collectionId

string

The collection ID, relative to parent, to list. For example: chatrooms.

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. name must not be set.

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

See also

google.firestore.v1beta1.CreateDocumentRequest definition in proto format

Cursor

static

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.

See also

google.firestore.v1beta1.Cursor definition in proto format

DeleteDocumentRequest

static

The request for Firestore.DeleteDocument.

Properties

Parameter

name

string

The resource name of the Document to delete. In the format: projects/{project_id}/databases/{database_id}/documents/{document_path}.

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

See also

google.firestore.v1beta1.DeleteDocumentRequest definition in proto format

Document

static

A Firestore document.

Must not exceed 1 MiB - 4 bytes.

Properties

Parameter

name

string

The resource name of the document, for example projects/{project_id}/databases/{database_id}/documents/{document_path}.

fields

Object with Object properties

The document's fields.

The map keys represent field names.

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.

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.

Field paths may be used in other contexts to refer to structured fields defined here. For map_value, the field path is represented by the simple or quoted field names of the containing fields, delimited by .. For example, the structured field "foo" : { map_value: { "x&y" : { string_value: "hello" }}} would be represented by the field path foo.x&y.

Within a field path, a quoted field name starts and ends with </code> and may contain any character. Some characters, including <code> , must be escaped using a \. For example, x&amp;y represents x&y and bak\tik</code> represents <code>baktik.

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 read_time of a query.

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 initally 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.

This object should have the same structure as Timestamp

See also

google.firestore.v1beta1.Document definition in proto format

DocumentChange

static

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 mask is set, contains only fields that were updated or added.

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.

See also

google.firestore.v1beta1.DocumentChange definition in proto format

DocumentDelete

static

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 commit_time of the delete.

This object should have the same structure as Timestamp

See also

google.firestore.v1beta1.DocumentDelete definition in proto format

DocumentMask

static

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.

See also

google.firestore.v1beta1.DocumentMask definition in proto format

DocumentRemove

static

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 commit_time of the change/delete/remove.

This object should have the same structure as Timestamp

See also

google.firestore.v1beta1.DocumentRemove definition in proto format

DocumentsTarget

static

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: 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.

See also

google.firestore.v1beta1.Target.DocumentsTarget definition in proto format

DocumentTransform

static

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 object should have the same structure as FieldTransform

See also

google.firestore.v1beta1.DocumentTransform definition in proto format

ExistenceFilter

static

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.

See also

google.firestore.v1beta1.ExistenceFilter definition in proto format

FieldFilter

static

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

See also

google.firestore.v1beta1.StructuredQuery.FieldFilter definition in proto format

FieldReference

static

A reference to a field, such as max(messages.time) as max_time.

Property

Parameter

fieldPath

string

See also

google.firestore.v1beta1.StructuredQuery.FieldReference definition in proto format

FieldTransform

static

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

See also

google.firestore.v1beta1.DocumentTransform.FieldTransform definition in proto format

Filter

static

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

See also

google.firestore.v1beta1.StructuredQuery.Filter definition in proto format

GetDocumentRequest

static

The request for Firestore.GetDocument.

Properties

Parameter

name

string

The resource name of the Document to get. In the format: projects/{project_id}/databases/{database_id}/documents/{document_path}.

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

See also

google.firestore.v1beta1.GetDocumentRequest definition in proto format

ListCollectionIdsRequest

static

The request for Firestore.ListCollectionIds.

Properties

Parameter

parent

string

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

pageSize

number

The maximum number of results to return.

pageToken

string

A page token. Must be a value from ListCollectionIdsResponse.

See also

google.firestore.v1beta1.ListCollectionIdsRequest definition in proto format

ListCollectionIdsResponse

static

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.

See also

google.firestore.v1beta1.ListCollectionIdsResponse definition in proto format

ListDocumentsRequest

static

The request for Firestore.ListDocuments.

Properties

Parameter

parent

string

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

collectionId

string

The collection ID, relative to parent, to list. For example: chatrooms or messages.

pageSize

number

The maximum number of documents to return.

pageToken

string

The next_page_token value returned from a previous List request, if any.

orderBy

string

The order to sort results by. For example: priority desc, name.

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 show_missing may not specify where or order_by.

See also

google.firestore.v1beta1.ListDocumentsRequest definition in proto format

ListDocumentsResponse

static

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.

See also

google.firestore.v1beta1.ListDocumentsResponse definition in proto format

ListenRequest

static

A request for Firestore.Listen

Properties

Parameter

database

string

The database name. In the format: projects/{project_id}/databases/{database_id}.

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.

See also

google.firestore.v1beta1.ListenRequest definition in proto format

ListenResponse

static

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

See also

google.firestore.v1beta1.ListenResponse definition in proto format

MapValue

static

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 .* 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.

See also

google.firestore.v1beta1.MapValue definition in proto format

Order

static

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 ASCENDING.

The number should be among the values of Direction

See also

google.firestore.v1beta1.StructuredQuery.Order definition in proto format

Precondition

static

A precondition on a document, used for conditional operations.

Properties

Parameter

exists

boolean

When set to true, the target document must exist. When set to false, the target document must not exist.

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

See also

google.firestore.v1beta1.Precondition definition in proto format

Projection

static

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 ['name'].

This object should have the same structure as FieldReference

See also

google.firestore.v1beta1.StructuredQuery.Projection definition in proto format

QueryTarget

static

A target specified by a query.

Properties

Parameter

parent

string

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

structuredQuery

Object

A structured query.

This object should have the same structure as StructuredQuery

See also

google.firestore.v1beta1.Target.QueryTarget definition in proto format

ReadOnly

static

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

See also

google.firestore.v1beta1.TransactionOptions.ReadOnly definition in proto format

ReadWrite

static

Options for a transaction that can be used to read and write documents.

Property

Parameter

retryTransaction

string

An optional transaction to retry.

See also

google.firestore.v1beta1.TransactionOptions.ReadWrite definition in proto format

RollbackRequest

static

The request for Firestore.Rollback.

Properties

Parameter

database

string

The database name. In the format: projects/{project_id}/databases/{database_id}.

transaction

string

The transaction to roll back.

See also

google.firestore.v1beta1.RollbackRequest definition in proto format

RunQueryRequest

static

The request for Firestore.RunQuery.

Properties

Parameter

parent

string

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

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

See also

google.firestore.v1beta1.RunQueryRequest definition in proto format

RunQueryResponse

static

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 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.

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.

See also

google.firestore.v1beta1.RunQueryResponse definition in proto format

StructuredQuery

static

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:

  • Any field required to appear in order_by, that is not already specified in order_by, is appended to the order in field name order by default.
  • 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 'ASCENDING' if no order was specified. For example:

  • SELECT FROM Foo ORDER BY A becomes SELECT FROM Foo ORDER BY A, name

  • SELECT FROM Foo ORDER BY A DESC becomes SELECT FROM Foo ORDER BY A DESC, name DESC
  • SELECT FROM Foo WHERE A > 1 becomes SELECT FROM Foo WHERE A > 1 ORDER BY A, name

    This object should have the same structure as Order

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

See also

google.firestore.v1beta1.StructuredQuery definition in proto format

Target

static

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 read_time.

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.

See also

google.firestore.v1beta1.Target definition in proto format

TargetChange

static

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 target_change_type=ADD, the order of the target IDs matches the order of the requests to add the targets. This allows clients to unambiguously associate server-assigned target IDs with added targets.

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 target_ids, or all targets if target_ids is empty.

Not set on every target change.

readTime

Object

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.

This object should have the same structure as Timestamp

See also

google.firestore.v1beta1.TargetChange definition in proto format

TransactionOptions

static

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

See also

google.firestore.v1beta1.TransactionOptions definition in proto format

UnaryFilter

static

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

See also

google.firestore.v1beta1.StructuredQuery.UnaryFilter definition in proto format

UpdateDocumentRequest

static

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

See also

google.firestore.v1beta1.UpdateDocumentRequest definition in proto format

Value

static

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: projects/{project_id}/databases/{database_id}/documents/{document_path}.

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 contain another array value.

This object should have the same structure as ArrayValue

mapValue

Object

A map value.

This object should have the same structure as MapValue

See also

google.firestore.v1beta1.Value definition in proto format

Write

static

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: projects/{project_id}/databases/{database_id}/documents/{document_path}.

transform

Object

Applies a tranformation to a document. At most one transform per document is allowed in a given request. An update cannot follow a transform on the same document in a given request.

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 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. The field paths in this mask must not contain a reserved field name.

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

See also

google.firestore.v1beta1.Write definition in proto format

WriteRequest

static

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: projects/{project_id}/databases/{database_id}. This is only required in the first message.

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 stream_id field.

Leave this field unset when creating a new stream.

labels

Object with string properties

Labels associated with this write request.

See also

google.firestore.v1beta1.WriteRequest definition in proto format

WriteResponse

static

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

See also

google.firestore.v1beta1.WriteResponse definition in proto format

WriteResult

static

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 delete.

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

See also

google.firestore.v1beta1.WriteResult definition in proto format