【发布时间】:2021-09-01 02:15:27
【问题描述】:
UserTable
---------
Username
Age
Gender
countryA
countryB
CityA
CityB
国家=意大利,城市=Jhb;
想通过查询firestore实现以下
if(country==countryA || country == countryB){
if(city == CityA || city == CityB){
//TODO
return the document;
}
}
尝试通过查询firestore来实现上述目标
CollectionReference colRef = fireStore.collection("UserTable");
colRef.whereEqualTo("countryA",country).get();
colRef.whereEqualTo("countryB",country).get();
colRef.whereEqualTo("CityA",city).get();
colRef.whereEqualTo("CityB",city).get();
接下来我要编码什么?
如何组合查询以获得成功的结果
【问题讨论】:
标签: java android firebase google-cloud-firestore