WriteBatch class

A write batch, used to perform multiple writes as a single atomic unit.

Get one with FirebaseFirestore.batch. None of the writes are sent until commit is called.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

commit() → Future<void>
Commits all of the writes in this batch as a single atomic unit. The future completes when the backend has applied them.
delete(DocumentReference<Object?> documentRef) → WriteBatch
Deletes the document referred to by documentRef.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set<T extends Object?>(DocumentReference<T> documentRef, T data, [SetOptions? options]) → WriteBatch
Writes data to the document referred to by documentRef. If the document does not exist yet, it is created. With merge options the data is merged into the existing document.
toString() → String
A string representation of this object.
inherited
update(DocumentReference<Object?> documentRef, Map<Object, Object?> data) → WriteBatch
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 batch fails if the document does not exist.

Operators

operator ==(Object other) → bool
The equality operator.
inherited