Transaction class
A Transaction is passed to the function given to FirebaseFirestore.runTransaction, to read and write documents within the transaction.
All the reads must come before the first write.
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
-
delete(
DocumentReference< Object?> documentRef) → Transaction -
Deletes the document referred to by
documentRef. -
get<
T extends Object?> (DocumentReference< T> documentRef) → Future<DocumentSnapshot< T> > -
Reads the document referred to by
documentRef. -
getAggregate(
AggregateQuery aggregateQuery) → Future< AggregateQuerySnapshot> -
Runs the aggregation
aggregateQueryon the backend inside this transaction. Only in a read-only transaction, like getQuery. -
getQuery<
T extends Object?> (Query< T> query) → Future<QuerySnapshot< T> > -
Runs
queryon the backend inside this transaction. Only in a read-only transaction (runTransaction(..., readOnly: true)): the documents are those of the snapshot of the database that every read of the transaction sees. -
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]) → Transaction -
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) → Transaction -
Updates the fields in
dataof the document referred to bydocumentRef. Each key is a field path: aString(dots separate nested fields) or aFieldPath. The transaction fails if the document does not exist.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited