【发布时间】:2020-12-21 14:18:08
【问题描述】:
我正在尝试获取文档中的所有集合,但出现错误。
我正在这样做:
this.db = firebase.firestore();
this.db.collection("RestaurantMenus").doc(this.restaurant.key).listCollections().then((querySnapshot) => {
querySnapshot.forEach((collection) => {
console.log("collection: " + collection.id);
});
它说 listCollections() 不是一个函数。我试过 getAllCollections() 它说的一样。我试图从文档中获取数据,但只获取数据而不是集合。
我不知道还能做什么。我做错了什么?
我的火库:
Collection ---> "RestaurantMenus" ----> doc: this.restaurant.key ----> 我想要获取的集合
【问题讨论】:
标签: javascript angular firebase google-cloud-firestore