The type of the document data.
Returns the document data. Throws an error if the document does not exist.
The document data.
Returns a read-only internal copy of the document data. This works similar to this.data
, except it does not
perform a defensive copy. The caller may not modify this object, on penalty of unexpected behavior.
The document data.
Returns whether data has been populated for this document reference. Data will not present if a document has not been queried, does not exist, or has been deleted.
Whether the document has data.
Decrements the value at the given path by the given value. The value may be both positive and negative.
Deletes the document.
The delete
will be reflected optimistically locally and will be applied to the server later.
If a transactionId is provided, the delete
will be applied to the server as an atomic operation together with
the rest of the operations in the transaction and the delete
will not reflect locally until the transaction is
completed locally.
The returned promise will resolve once the delete
has been applied to the server or immediately if the delete
is part of a transaction.
Optional
transactionId: stringThe transaction to use for this operation. If not provided, the operation will be applied immediately.
Increments the value at the given path by the given value. The value may be both positive and negative.
Inserts the document with the given data. If the document already exists, the operation will be treated as
upsert
. The insert
will be reflected optimistically locally and will be applied to the server later. If a
transactionId is provided, the insert
will be applied to the server as an atomic operation together with the
rest
of the operations in the transaction and the insert
will not reflect locally until the transaction is completed
locally.
The returned promise will resolve once the insert
has been applied to the server or immediately if the insert
is part of a transaction.
The data to insert.
Optional
transactionId: stringThe transaction to use for this operation. If not provided, the operation will be applied immediately.
Returns whether the locally available version of the document may not be the latest version on the server.
Whether the locally available version of the document may not be the latest version on the server.
Returns the data that is currently available on the client or undefined if data has not yet been populated.
The data that is currently available on the client or undefined if data has not yet been populated.
Similar to update, but only updates the given path.
The path to update.
The value to set at the given path.
Optional
transactionId: stringThe transaction to use for this operation. If not provided, the operation will be applied immediately.
A promise that resolves with the latest data from the server or undefined if the document does not exist on the server.
A promise that resolves with latest data from the server or undefined if the document does not exist on the server.
Returns an observable that emits the latest data from the server or undefined if the document is deleted or does not exist on the server.
An observable that emits the latest data from the server or undefined if the document is deleted or does not exist on the server.
Updates the document with the given data.
The update
will be reflected optimistically locally and will be applied to the server later.
If a transactionId is provided, the update
will be applied to the server as an atomic operation together with
the rest of the operations in the transaction and the update
will not reflect locally until the transaction is
completed locally.
The returned promise will resolve once the update
has been applied to the server or immediately if the update
is part of a transaction.
The data to update - can be partial.
Optional
transactionId: stringThe transaction to use for this operation. If not provided, the operation will be applied immediately.
Holds a reference to a document. A document reference is a reference to a specific record in a collection. You can use it to read or write data to the document. A document can refer to a row in a table in a relational database or a document in a NoSQL database. Additionally, a document reference can refer to a non-existent document, which you can use to create a new document.
Read more about document references in the documentation.