Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Firebase 无法将事务集与SetOptions合并_Firebase_Flutter_Dart_Google Cloud Firestore - Fatal编程技术网

Firebase 无法将事务集与SetOptions合并

Firebase 无法将事务集与SetOptions合并,firebase,flutter,dart,google-cloud-firestore,Firebase,Flutter,Dart,Google Cloud Firestore,我必须使用事务来设置和更新Firestore中的某些数据。如果旧数据已经存在,我想合并新数据。这在没有交易的情况下是可能的,但有了它们,我似乎无法做到,即使它说你可以做到 从Flatter Firestore实现中,我可以看到以下文档: /// Writes to the document referred to by the provided [DocumentReference]. /// If the document does not exist yet, it will be crea

我必须使用事务来设置和更新Firestore中的某些数据。如果旧数据已经存在,我想合并新数据。这在没有交易的情况下是可能的,但有了它们,我似乎无法做到,即使它说你可以做到

从Flatter Firestore实现中,我可以看到以下文档:

/// Writes to the document referred to by the provided [DocumentReference].
/// If the document does not exist yet, it will be created. If you pass
/// SetOptions, the provided data can be merged into the existing document.
  Future<void> set(
  ///.....

在Firestore的Flatter版本中有可能做到这一点吗?或者这是一个错误,尚未实现?

查看,似乎没有一个transaction.set()的变体,它接受类似于
SetOptions的内容。您可能想了解这一点。

我发布了一个问题,但团队似乎没有注意到。
  transaction.set(doc.reference, {
    "liked": FieldValue.arrayUnion([entryInfo.id]),
  });