【发布时间】:2019-04-11 16:54:56
【问题描述】:
我正在尝试获取集合中的文档列表,但没有获取任何文档, 这是我正在尝试的代码- `
schoolProductCollectionFetch(schoolName){
const school = this.db.collection(schoolName)
this.school$ = school.snapshotChanges().pipe(map(schoollist=>schoollist.map(s=>{
const data = s.payload.doc.id;
console.log(data);
return data;
})));
return this.school$
}
数据库格式: SchoolCollection->Documents->ProductCollection
SchoolCollection:{
1st:{products:{}},
2nd:{products:{}},
}
已尝试将数据格式表示为 firestore 中的数据格式,我想获得第一个,第二个,它们是 SchoolCollection 的文档 ID, 架构快照:
【问题讨论】:
标签: angular firebase google-cloud-firestore angularfire2