我正在使用 firestore where() 方法来测试嵌套字段与另一个值的相等性。嵌套字段位于文档结构中:Apartments/Apartment/property/address/ locality_short
这是我目前的做法(在下面的代码中),但它没有返回任何文档: //There import import { AngularFirestore} from 'angularfire2/firestore';
//注入构造函数(private afs: AngularFirestore){}
//根据是否 //apartment.property.address.locality_short == search_object.locality_short 来检索公寓的方法
search(search_obj: Search):Observable{ return this.afs.collection('/Apartments', ref => ref.where( property,address,locality_short
, '==', 'search_obj.Address.locality_short')).valueChanges() }