【发布时间】:2018-08-24 08:58:23
【问题描述】:
我在我的数据库中存储了用户喜欢的帖子的 IDS 列表,现在我想显示他喜欢的帖子列表。
我正在尝试使用 RXJS 将 IDS 映射到帖子。
到目前为止,我在快照中获得了 id 列表,但我不确定如何将它们切换到文档本身:
myLikedConfessions() {
return this.db.doc(this.USER_COLLECTION)
.collection('likedConfs',
ref => ref.limit(5))
.snapshotChanges()
.mergeMap((ids) => {
console.log(ids);
// each id should have the observable result of: this.db.collection('posts').doc(docID);
return Observable.of({});
})
}
有什么想法吗?
【问题讨论】:
标签: angular rxjs google-cloud-firestore angularfire2