【发布时间】:2020-09-23 23:33:37
【问题描述】:
是否可以使用 python 列出文档的子集合? 谷歌文档似乎不一致
这里他们说 Python 客户端库中没有 get collections 方法:
https://firebase.google.com/docs/firestore/query-data/get-data#python_6
这里他们说 class collections() 列出子集合:
https://googleapis.dev/python/firestore/latest/document.html
所以我尝试了类似的方法:
collnameref = db.collection(collname)
docs = collnameref.stream()
for doc in docs:
print (doc.collections())
但它不起作用。
【问题讨论】:
-
“但它对我不起作用” - 请使用未按预期方式工作的代码编辑问题,并解释它是什么实际上是在做。请阅读:stackoverflow.com/help/minimal-reproducible-example
标签: python firebase google-cloud-firestore