0

In firebase, when we want to filter data we have 3 parameter to query data.

startAt - For Start Point [can be used in conjunction with endAt]

endAt - For end point [can be used in conjunction with startAt]

equalTo - For specifying equal to [Used alone]

Example1: to retrieve all dinosaurs with a height greater than 3

curl 'https://dinosaur-facts.firebaseio.com/dinosaurs.json?orderBy="height"&startAt=3

Example2 : The following example retrieves all dinosaurs with a name starting with the letter a through m

curl 'https://dinosaur-facts.firebaseio.com/dinosaurs.json?orderBy="$key"&startAt="a"&endAt="m"

Question -

Is there any way where I can filter using notEqualTo? or similar functionality.

curl 'https://dinosaur-facts.firebaseio.com/dinosaurs.json?orderBy="type"&notQualTo="small"

So that I can retrieve type big and medium dinos.

I am using firebase using REST APIs only. Another Question is posted which is related to using Firebase in Android

Community
  • 1
  • 1
Adarsh Madrecha
  • 6,364
  • 11
  • 69
  • 117
  • 1
    There is currently no way to filter for the absence of a value or inequality. see http://stackoverflow.com/questions/28582223/is-it-possible-query-data-that-are-not-equal-to-the-specified-condition – Frank van Puffelen Jul 09 '16 at 14:34
  • @FrankvanPuffelen, This Question is about REST and the question you mentioned is Android. Hence not a duplicate. I am also open to suggestion on how this can be achieved if direct functionality is not available. – Adarsh Madrecha Jul 09 '16 at 14:38
  • The functionality is exactly the same across REST, Android, iOS and JavaScript. The answer I could post here would thus also be exactly the same, which makes it a duplicate. – Frank van Puffelen Jul 09 '16 at 15:42

0 Answers0