set<T> method

Transaction set<T>(
  1. DocumentReference<T> docRef,
  2. T data
)

Sets fields provided in data for the document referred to by docRef.

All fields will be overwritten with the provided data. This means that all fields that are not specified in data will be deleted.

If the document does not yet exist, it will be created.

Implementation

Transaction set<T>(
  DocumentReference<T> docRef,
  T data,
) {
  _transactionWriteBatch.set(docRef, data);
  return Transaction._(
    _firestore,
    _transactionId,
    _transactionWriteBatch,
  );
}