deleteOnTransaction method

  1. @override
void deleteOnTransaction(
  1. ModelTransactionRef ref,
  2. ModelAdapterDocumentQuery query
)
override

Describe the data deletion 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.

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

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

Implementation

@override
void deleteOnTransaction(
  ModelTransactionRef ref,
  ModelAdapterDocumentQuery query,
) {
  _assert();
  if (ref is! LocalModelTransactionRef) {
    throw Exception("[ref] is not [LocalModelTransactionRef].");
  }
  ref._transactionList.add(() => deleteDocument(query));
}