set<T> method

  1. @override
void set<T>(
  1. DocumentReference<T> document,
  2. T data, [
  3. SetOptions? options
])
override

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

@override
void set<T>(
  DocumentReference<T> document,
  T data, [
  SetOptions? options,
]) {
  if (!_hasUncommittedChanges) {
    _hasUncommittedChanges = true;
  }
  return batch.set(document, data, options);
}