UNPKG

voluptasmollitia

Version:
32 lines (19 loc) 1.34 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@firebase/firestore](./firestore.md) &gt; [/](./firestore_.md) &gt; [WriteBatch](./firestore_.writebatch.md) &gt; [update](./firestore_.writebatch.update_1.md) ## WriteBatch.update() method Updates fields in the document referred to by this [DocumentReference](./firestore_.documentreference.md)<!-- -->. The update will fail if applied to a document that does not exist. Nested fields can be update by providing dot-separated field path strings or by providing `FieldPath` objects. <b>Signature:</b> ```typescript update(documentRef: DocumentReference<unknown>, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): WriteBatch; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | documentRef | [DocumentReference](./firestore_.documentreference.md)<!-- -->&lt;unknown&gt; | A reference to the document to be updated. | | field | string \| [FieldPath](./firestore_.fieldpath.md) | The first field to update. | | value | unknown | The first value. | | moreFieldsAndValues | unknown\[\] | Additional key value pairs. | <b>Returns:</b> [WriteBatch](./firestore_.writebatch.md) This `WriteBatch` instance. Used for chaining method calls.