【问题标题】:how to change one element value of specific index of array in firebase uisng flutter? [duplicate]如何使用颤动更改firebase中数组特定索引的一个元素值? [复制]
【发布时间】:2021-05-13 20:50:26
【问题描述】:

我想在通知时间戳的特定索引上将取值更改为 true(fire base 中的数组,如图所示)所以我如何编写查询 [1]:https://i.stack.imgur.com/aGWpI.jpg

我的代码:-

await FirebaseFirestore.instance
    .collection('Prescriptions')
    .doc(medicineDetails['id'].toString())
    .update({
        'NotificationTimeStamp ': FieldValue.arrayUnion([{}])
    });

【问题讨论】:

    标签: firebase flutter dart google-cloud-firestore


    【解决方案1】:

    您只能从数组中添加或删除,但作为一种变通方法,您可以通过更改代码中的数组来替换 firebase 中的数组来做到这一点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-01-07
      • 2019-11-16
      • 2019-05-27
      • 1970-01-01
      • 2022-01-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多