loadOnTransaction method

  1. @override
FutureOr<DynamicMap> loadOnTransaction(
  1. ModelTransactionRef ref,
  2. ModelAdapterDocumentQuery query
)
override

Describe the data acquisition process when performing a transaction.

The ModelTransactionRef created by runTransaction is passed to ref and the query of the target document is passed to query.

Return a Json map retrieved from the database in the return value.

トランザクションを行う際のデータ取得処理を記述します。

refrunTransactionで作成したModelTransactionRefが渡され、queryは対象のドキュメントのクエリが渡されます。

戻り値にデータベースから取得したJsonマップを返してください。

Implementation

@override
FutureOr<DynamicMap> loadOnTransaction(
  ModelTransactionRef ref,
  ModelAdapterDocumentQuery query,
) {
  _assert();
  return loadDocument(query);
}