WriteBatch class

Enables writing many values at once.

An example:

final batch = database.newWriteBatch();
batch.upsert(exampleDocument, {
  'k': 'v',
});
batch.commit();

Constructors

WriteBatch()
WriteBatch.simple()
Returns default implementation of WriteBatch.
factory

Properties

done Future<void>
Completes with value :null when the transaction is committed. Completes with error TransactionFailureException if the transaction is rolled back.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

commit() Future<void>
Commits the transaction (if possible).
deleteIfExists(Document document) → void
Deletes the document if it exists.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited
update(Document document, {Map<String, Object> data}) → void
Updates the document.
upsert(Document document, {Map<String, Object> data}) → void
Upserts (inserts or updates) the document.

Operators

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