【发布时间】:2019-11-23 00:05:30
【问题描述】:
在 ionic 中,我想从 firestore 的特定字段(例如 Name 那里)获取和显示信息,但问题是它也显示其他文档的字段 Names。
ngOnInit(){
this.authService.readc().subscribe(data => {
this.datas = data.map(e => {
return {
Name: e.payload.doc.data()['Name'],
};
})
console.log(this.datas);
});
}
}
name() {
var counter = this.firestore.doc(`info/${this.authService.userDetails().uid}`);
counter.set({
Name: this.Name
})
}
在 authService 中
readc() {
return this.firestore.collection('info').snapshotChanges();
}
【问题讨论】:
标签: firebase ionic-framework google-cloud-firestore ionic4