【问题标题】:How to access the value of a map field in cloud_firestore如何访问 cloud_firestore 中地图字段的值
【发布时间】:2018-11-15 17:05:04
【问题描述】:

我正在使用 cloud_firestore: ^0.8.2+2 - 我正在尝试使用键值对访问名为“实体”的文档上的 映射字段。键 = "id" 和值 = "1" 。

我尝试使用以下语法documents[index].data['entity.id'] - 不成功。

我已使用以下语法成功访问了非地图字段标题。 documents[index].data['title'].toString()

任何帮助将不胜感激。

【问题讨论】:

  • 你试过documents[index].data['entity']['id'] 吗?
  • 你在开玩笑,就是这样。我发誓我试过了,谢谢。

标签: flutter google-cloud-firestore


【解决方案1】:

这就是它的解决方法documents[index].data['entity']['id']。谢谢@anmol.majhail

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-08-28
    • 1970-01-01
    • 2014-07-03
    • 1970-01-01
    • 1970-01-01
    • 2020-11-09
    • 2021-01-03
    相关资源
    最近更新 更多