【发布时间】:2020-06-03 16:21:43
【问题描述】:
我正在使用 Firestore
我有健康名称集合
collection health
doc customername
collection customerinfo // multiple
doc customerwardinfo
代码:
firebase.firestore()
.collection("health")
.doc('customername')
.get()
.then((data)=>{
console.log("customer data",data);
})
我正在使用上面的代码,但没有获取数据。我想为每个子集合使用。但我无法实现它。我将如何获取所有数据。假设一个集合有 10 个文档。然后对每个文档使用 foreach 并从每个文档中获取数据。
【问题讨论】:
-
如果您询问如何获取特定文档的所有子集合的列表,客户端 SDK 无法做到这一点。见stackoverflow.com/questions/46596532/…
标签: javascript react-native google-cloud-firestore react-native-firebase