【问题标题】:how to use the parent option in flutter in cloudfirestore?如何在 Cloud Firestore 中使用颤振中的父选项?
【发布时间】:2018-10-13 21:34:40
【问题描述】:

我只想知道 parent 选项在 streambuilder 中返回什么,因为文档中没有提到它:

Firestore.instance
         .collection('Doctors')
         .Parent()
         .snapshots(),

这是否返回包含此子集合的文档数据?还是返回不同的东西??

【问题讨论】:

    标签: firebase dart flutter google-cloud-firestore


    【解决方案1】:

    来自documentation for the parent method

    对于子集合,父级返回包含DocumentReference

    对于根集合,返回null

    您现在编写它的方式Doctors 是一个顶级集合。对于这样的集合,调用parent() 返回null

    【讨论】:

      猜你喜欢
      • 2020-12-14
      • 2019-09-21
      • 2019-05-25
      • 2021-03-01
      • 2022-01-21
      • 2021-06-01
      • 2021-12-29
      • 2021-12-16
      • 2021-11-25
      相关资源
      最近更新 更多