我必须使用事务来设置和更新Firestore中的某些数据。如果旧数据已经存在,我想合并新数据。这在没有事务的情况下是可能的,但是有了它们,我似乎无法做到这一点,即使它说你可以做到。从Flutter Firestore实现中,我可以看到以下文档:
/// Writes to the document referred to by the provided [DocumentReference我在谷歌上搜索过SetOptions类,它确实存在于理论上(),但我似
我希望在不存在的情况下创建修复文档--如果它们确实存在,请跳过它们(不要更新)。这是流程for (var id of arrayOfRandomIds) var ref= db.collection("tickets").doc(id);
batch.set(ref, {name: "My name", location: "Somewhe