【发布时间】:2022-07-12 17:03:48
【问题描述】:
我正在制作一些 API,其中很多东西能够通过值检索相应的文档。 我的数据结构如下
Schools (collection) -> Lombardy (doc) -> Milan (collection) -> Milan (doc) - School Test1 (collection) -> 0 (doc) -> document
在学校文件中有以下信息:
address: School address 1
INFORMATICS {
4A INF: "GA24HJ"
}
我的目标是使用代码 GA24HJ 检索学校名称 (School Test1) 和 address。
我的代码:
firestore = firestore.client()
collections = firestore.collections()
for doc in collections.stream():
print(f'{doc.id} => {doc.to_dict()}')
结果:
Lombardy => {}
我想澄清一下,我没有在网上找到任何有用的东西,我正在使用 Python 和 admin sdk。
【问题讨论】:
标签: python database api google-cloud-firestore google-admin-sdk