set method

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

Writes to the document referred to by document.

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

If SetOptions are provided, the data will be merged into an existing document instead of overwriting.

Implementation

void set(DocumentReference document, Map<String, dynamic> data,
    [SetOptions? options]) {
  assert(document.firestore == _firestore,
      'the document provided is from a different Firestore instance');
  return _delegate.set(document.path,
      _CodecUtility.replaceValueWithDelegatesInMap(data)!, options);
}