【发布时间】:2018-10-26 19:26:18
【问题描述】:
嘿,我找不到如何在 firestore 中进行嵌套查询?
this.match1 = this.MatchCollection1.snapshotChanges().pipe(map(actions => {
return actions.map(a => {
const data = a.payload.doc.data() as Matches;
const uid = data.pairer;
const id = a.payload.doc.id;
const photourl = afs.collection(`users/${uid}/photos`,
ref => ref.where('index', '==', 0).where('deleted', '==', false)).snapshotChanges().pipe(map(action => {
return action.map(p => {
const pdata = p.payload.doc.data() as Photos;
return pdata.url;
});
}));
return {id, uid, url: photourl, ...data};
});
}));
我的问题 photourl 返回 observable 我怎样才能像其他人一样返回对象
【问题讨论】:
-
谁知道这个?
-
你能提供你的数据结构并解释你期望什么样的结果吗?
-
我想把 photourl 串起来
标签: firebase nested angular6 angularfire2 rxjs6