Javascript 如何基于父项´获取firestore子集合中的所有文档;s文档值?

Javascript 如何基于父项´获取firestore子集合中的所有文档;s文档值?,javascript,firebase,google-cloud-firestore,Javascript,Firebase,Google Cloud Firestore,我在Firebase Firestore中有一个子集合的路径:团队/TeamName/Meetings/First/Data。我想知道是否有办法根据第一个文档(父文档)中的值(字段)获取数据子集合中的文档 我试过这个: db.collection("Team") .doc("TeamName") .collection('Meetings').where('0', '==', "some data

我在Firebase Firestore中有一个子集合的路径:团队/TeamName/Meetings/First/Data。我想知道是否有办法根据第一个文档(父文档)中的值(字段)获取数据子集合中的文档

我试过这个:

 db.collection("Team")
            .doc("TeamName")
            .collection('Meetings').where('0', '==', "some data")
            .where('3', '==', "doc data")
            .where('4', '==', "something in textfiel").collection("Data")

但是这个方法不起作用。

FixStury查询只能考虑查询的集合或子集合中的文档字段。不存在跨多个集合在文档之间组合数据的“联接”

您尝试执行的操作至少需要两个查询。首先,从“团队”获取父文档的查询:

然后,对于每个匹配的父文档,您将需要对每个子集合中的文档进行更多查询

db
    .collection("Team")
    .doc(matchingDocId)
    .collection("Meetings")
    .where(/* Any filters on documents in Meetings */)
    .get()

团队是根(第一个)集合。我获取它,获取集合,然后通过匹配doc.id的doc获取子集合。谢谢您的时间:)
db
    .collection("Team")
    .doc(matchingDocId)
    .collection("Meetings")
    .where(/* Any filters on documents in Meetings */)
    .get()