Morrowless
Morrowless

Reputation: 6958

Firestore batch write in a transaction?

Is there a way to perform a batched write in a transaction? I understand the batched write itself is atomic, but I need to do other writes that are contingent on the batched write succeeding.

Upvotes: 0

Views: 269

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317828

There's no way to perform a batch within a transaction, or nest a transaction inside another transaction. There are no multi-stage transactions. It sounds like you might need to do multiple transactions, and figure out how to revert the first transaction if the second one fails.

Upvotes: 2

Related Questions