我想显示使用machineRef和siteRef检索所有机器站点地图
getActiveMachineSiteMap() {
return this.db.collection('machine-site-map',
ref => ref.where('IsActive', '==', true))
.valueChanges({ idField: 'Id' });
}
因此,我没有机器和站点
根据有关Querying and filtering data的文档示例,方法db.collection仅使用一个参数。所以在这种情况下,您的功能应该像这是文档存储模型。消防站的屏幕截图我想显示使用machineRef和siteRef检索所有机器站点地图
getActiveMachineSiteMap() {
return this.db.collection('machine-site-map').where('IsActive', '==', true)
.valueChanges({ idField: 'Id' });
}
还有一些关于Collections in AngularFirestore的文档,您可以在github中查看,它可能有助于您解决一些疑问。