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
datato the document referred to bydocumentRef. If the document does not exist yet, it is created. With mergeoptionsthe 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
dataof the document referred to bydocumentRef. Each key is a field path: aString(dots separate nested fields) or aFieldPath. The batch fails if the document does not exist.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited