voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
28 lines (16 loc) • 1.16 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/firestore](./firestore.md) > [lite](./firestore_lite.md) > [Transaction](./firestore_lite.transaction.md) > [update](./firestore_lite.transaction.update.md)
## Transaction.update() method
Updates fields in the document referred to by the provided [DocumentReference](./firestore_.documentreference.md)<!-- -->. The update will fail if applied to a document that does not exist.
<b>Signature:</b>
```typescript
update(documentRef: DocumentReference<unknown>, data: UpdateData): this;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| documentRef | [DocumentReference](./firestore_lite.documentreference.md)<!-- --><unknown> | A reference to the document to be updated. |
| data | [UpdateData](./firestore_lite.updatedata.md) | An object containing the fields and values with which to update the document. Fields can contain dots to reference nested fields within the document. |
<b>Returns:</b>
this
This `Transaction` instance. Used for chaining method calls.