The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

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.