【发布时间】:2020-10-09 18:59:29
【问题描述】:
我正在使用 google 的 firestore 数据库系统以及 Angular 和 NgRx 以及 NgRx Entity and Data 开发一个应用程序。
我想调用数据库并将数据作为给定类型(设计)的可观察数组返回。问题是firestore返回的observable不是我需要的类型,所以这个函数不起作用。我应该遍历数据并设置每个项目吗?有没有我想强制输入的地方?调用是否不起作用并因此返回错误?
这是对 firebase 服务的调用。
return this.afs.collection('designs', ref => ref
.where('status', '==', 1 )
.where('deleted', '==', false))
.valueChanges();
npm start 中的错误消息
Type 'Observable<unknown[]>' is not assignable to type 'Observable<makDesign[]>'.
【问题讨论】:
标签: angular firebase google-cloud-firestore ngrx