Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/305.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Firestore:使用python列出文档的子集合_Python_Firebase_Google Cloud Firestore - Fatal编程技术网

Firestore:使用python列出文档的子集合

Firestore:使用python列出文档的子集合,python,firebase,google-cloud-firestore,Python,Firebase,Google Cloud Firestore,是否可以使用python列出文档的子集合? 谷歌的文档似乎不协调 在这里,他们说get collections方法在Python客户端库中不可用: 这里他们说类集合列出子集合: 因此,我尝试了以下方法: collnameref = db.collection(collname) docs = collnameref.stream() for doc in docs: print (doc.collections()) 但是它不起作用。你说得对。文档中缺少以下内容: collnamere

是否可以使用python列出文档的子集合? 谷歌的文档似乎不协调

在这里,他们说get collections方法在Python客户端库中不可用:

这里他们说类集合列出子集合:

因此,我尝试了以下方法:

collnameref = db.collection(collname)
docs = collnameref.stream()
for doc in docs:
    print (doc.collections())

但是它不起作用。

你说得对。文档中缺少以下内容:

collnameref = db.collection(collname)
docs = collnameref.stream()
for doc in docs:
    # List subcollections in each doc
    for collection_ref in doc.reference.collections():
        print(collection_ref.parent.path + collection_ref.id)

你说得对。文档中缺少以下内容:

collnameref = db.collection(collname)
docs = collnameref.stream()
for doc in docs:
    # List subcollections in each doc
    for collection_ref in doc.reference.collections():
        print(collection_ref.parent.path + collection_ref.id)

但是这对我来说不起作用-请用你期望的不起作用的代码编辑这个问题,并解释它实际上在做什么。请阅读:但这对我来说不起作用-请用不符合预期的代码编辑问题,并解释它实际上在做什么。请阅读:谢谢胡安!我们是否可以假设这也将很快在文件中得到解决-我们在上面:-谢谢你,胡安!我们是否可以假设这也将很快在文件中得到解决-我们正在进行:-