当然上面的问题:多尝试几次,就会成功的
云数据事务报错:ResourceUnavailable.TransactionConflict?[图片] "document.update:fail [ResourceUnavailable.TransactionConflict] Transaction is conflict, maybe resource operated by others. Please check your request, but if the problem persists, contact us.; at document.update api; " 云数据库的一个简单事务处理,代码如下: const cmd = db.command; const updtranscation = await db.startTransaction(); res = await updtranscation.collection('xinfo').doc(_id).update({ data: info }); if(info.total_pay>0){ res = await updtranscation.collection("xaction").doc(info._id).update({ data:{ total_pay:cmd.inc(info.total_pay) } }); } updtranscation.commit();
2020-02-15