update method

Transaction update(
  1. DocumentReference<Object?> documentRef,
  2. Map<Object, Object?> data
)

Updates the fields in data of the document referred to by documentRef. Each key is a field path: a String (dots separate nested fields) or a FieldPath. The transaction fails if the document does not exist.

Implementation

Transaction update(
  DocumentReference<Object?> documentRef,
  Map<Object, Object?> data,
) {
  _firestore.validateReference(documentRef);
  _transaction.update(
    documentRef.key,
    _firestore.dataConverter.parseUpdateMap(
      data,
      methodName: 'Transaction.update',
      targetDoc: documentRef.key,
    ),
  );
  return this;
}