ModelTransactionDocumentBuilder<T> class

Builder for transactions.

ModelTransactionDocument can be created from other DocumentBase using ModelTransactionRef.read, and the process to be executed together can be written.

ModelTransactionDocument.load, ModelTransactionDocument.save, and ModelTransactionDocument.delete using ModelTransactionDocument. transaction processing can be performed by executing

トランザクションを行うためのビルダー。

ModelTransactionRef.readを用いて他のDocumentBaseからModelTransactionDocumentを作成することができ、まとめて実行する処理を記述することができます。

ModelTransactionDocumentを用いてModelTransactionDocument.loadModelTransactionDocument.saveModelTransactionDocument.deleteを実行することでトランザクション処理を行うことが可能です。

final transaction = sourceDocument.transaction();
transaction((ref, document){
  final doc = ref.read(document); // `doc` is [ModelTransactionDocument] of `sourceDocument`.
  final newValue = {"name": "test"}; // The same mechanism can be used to perform the same preservation method as usual.
  doc.save(newValue);
});
Available Extensions

Properties

document DocumentBase<T>
Original document.
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

call(FutureOr<void> transaction(ModelTransactionRef ref, DocumentBase<T> doc)) FutureOr<void>
transaction is passed as a callback to execute the transaction.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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