I've uploaded a geojson file to my firebase realtime database and setup an http get request in my angular app to retrieve the data. Here's a small sample of my data. All it is is an array of objects. Each object is a zip code. Below are two zip code objects.
[
{
"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
]
]
]
}
}
]
I can retrieve all of my data no problem but I can't seem to filter specific zip codes. I have read over the guides on firebase (https://firebase.google.com/docs/database/rest/retrieve-data) and can not get this to work with params. What I'm trying to do is filter an object based on the "ZCTA5CE10" value in "properties". I have tried many different combinations. Below is one of them:
getZipData() {
return this.http.get(this.url + '?orderBy="properties/ZCTA5CE10"&equalTo="02818"');
}
I get a 400 error when attempting to use params. What am I doing wrong?
Also, Is it possible to filter multiple zip codes E.g. &equalTo="02818"&equalTo="02878"