How to abort a Firestore transaction in case of error
问题 I'm using Firestore runTransaction method in a https Cloud function (running Express). What I want is ensure that if any of the read or write fails the other transaction reads or writes won't run or will rollback if needed. Transaction admin.firestore().runTransaction(async (t) => { const { uid, artworkUid, tagLabel } = req.body; if (!tagLabel) { return Promise.reject('Missing parameters: "tagLabel"'); } if (!artworkUid) { return Promise.reject('Missing parameters: "artworkUid"'); } if