【问题标题】:Flutter - Update values of maps and arrays in Cloud firestoreFlutter - 在 Cloud Firestore 中更新地图和数组的值
【发布时间】:2021-01-26 16:28:56
【问题描述】:

我的 Cloud Firestore 数据库如下

这里Education 是一个映射,Skills 是一个数组。我有更多的数组和地图。如何使用颤振编辑这些值。

我猜可能像

return Firestore.instance.collection('data/users/$uid')
        .document('user_data')
        .updateData({
      "Education[High school]" : _highSchool,
    });
  }

【问题讨论】:

    标签: firebase flutter dart google-cloud-firestore


    【解决方案1】:

    没有测试,但也许这会工作

    return Firestore.instance.collection('data/users/$uid')
            .document('user_data')
            .setData({
          "Education.High school" : _highSchool,
        });
      }
    

    也有类似的问题,看看 Update the Map field - Flutter

    【讨论】:

      猜你喜欢
      • 2020-11-08
      • 1970-01-01
      • 1970-01-01
      • 2020-08-01
      • 2021-07-31
      • 2022-01-08
      • 1970-01-01
      • 2019-09-03
      • 2019-10-23
      相关资源
      最近更新 更多