set method

Transaction set(
  1. DocumentReference documentReference,
  2. Map<String, dynamic> data, [
  3. SetOptions? options
])

Writes to the document referred to by the provided DocumentReference. If the document does not exist yet, it will be created. If you pass SetOptions, the provided data can be merged into the existing document.

Implementation

Transaction set(
    DocumentReference documentReference, Map<String, dynamic> data,
    [SetOptions? options]) {
  assert(documentReference.firestore == _firestore,
      'the document provided is from a different Firestore instance');

  return Transaction._(
      _firestore,
      _delegate.set(documentReference.path,
          _CodecUtility.replaceValueWithDelegatesInMap(data)!, options));
}