我已将geojson文件上传到我的firebase实时数据库,并在我的角应用中设置了http get请求以检索数据。这是我的数据的一小部分样本。它只是一个对象数组。每个对象都是一个邮政编码。以下是两个邮政编码对象。
[
{
"type":"Feature",
"properties":{
"STATEFP10":"44",
"ZCTA5CE10":"02818",
"GEOID10":"4402818",
"CLASSFP10":"B5",
"MTFCC10":"G6350",
"FUNCSTAT10":"S",
"ALAND10":56516634,
"AWATER10":8882294,
"INTPTLAT10":"+41.6429192",
"INTPTLON10":"-071.4857186",
"PARTFLG10":"N"
},
"geometry":{
"type":"Polygon",
"coordinates":[
[
[
-71.457848,
41.672076
],
[
-71.457848,
41.672414
],
[
-71.457848,
41.672932
],
[
-71.457916,
41.67407
]
]
]
}
},
{
"type":"Feature",
"properties":{
"STATEFP10":"44",
"ZCTA5CE10":"02878",
"GEOID10":"4402878",
"CLASSFP10":"B5",
"MTFCC10":"G6350",
"FUNCSTAT10":"S",
"ALAND10":75250623,
"AWATER10":8363563,
"INTPTLAT10":"+41.6101375",
"INTPTLON10":"-071.1804709",
"PARTFLG10":"N"
},
"geometry":{
"type":"Polygon",
"coordinates":[
[
[
-71.210351,
41.656166
],
[
-71.209897,
41.657718
],
[
-71.208399,
41.660013
],
[
-71.20787,
41.661323
]
]
]
}
}
]
我可以检索所有数据没问题,但我似乎无法过滤特定的邮政编码。我已阅读firebase上的指南(https://firebase.google.com/docs/database/rest/retrieve-data)并且无法使用params。我想要做的是根据" ZCTA5CE10"过滤对象。值"属性"。我尝试了很多不同的组合。以下是其中之一:
getZipData() {
return this.http.get(this.url + '?orderBy="properties/ZCTA5CE10"&equalTo="02818"');
}
尝试使用params时出现400错误。我做错了什么?
此外,是否可以过滤多个邮政编码。 &安培; equalTo =" 02818"&安培; equalTo =" 02878"