WriteBatch class

A Firestore WriteBatch that can be used to atomically commit multiple write operations at once.

Properties

firestore Firestore
final
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<List<WriteResult>>
Atomically commits all pending operations to the database and verifies all preconditions. Fails the entire write if any precondition is not met.
create<T>(DocumentReference<T> ref, T data) → void
Create a document with the provided object values. This will fail the batch if a document exists at its location.
delete(DocumentReference<Object?> documentRef, {Precondition? precondition}) → void
Deletes a document from the database.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set<T>(DocumentReference<T> documentReference, T data) → void
Write to the document referred to by the provided DocumentReference. If the document does not exist yet, it will be created.
toString() String
A string representation of this object.
inherited
update(DocumentReference<Object?> documentRef, UpdateMap data, {Precondition? precondition}) → void
Update fields of the document referred to by the provided DocumentReference. If the document doesn't yet exist, the update fails and the entire batch will be rejected.

Operators

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