Home > @firebase/firestore > lite > Transaction > set
Transaction.set() method
Writes to the document referred to by the provided DocumentReference. If the document does not exist yet, it will be created.
Signature:
set<T>(documentRef: DocumentReference<T>, data: T): this;
Parameters
Parameter | Type | Description |
---|---|---|
documentRef | DocumentReference<T> | A reference to the document to be set. |
data | T | An object of the fields and values for the document. |
Returns:
this
This Transaction
instance. Used for chaining method calls.