1

I have a project where I use Firebase's real time database. The project has a lot of records so I have been using orderByChild on my queries, so I only get the records I'm interested in and not all records in the node, like so:

return this.angularFireDataBase.database.ref().child('users/').orderByChild('is_supervisor').equalTo('si');

But now I need to get records whose is_supervisor property is null or doesn't even exist. Is this possible? And how?

Multitut
  • 2,089
  • 7
  • 39
  • 63
  • 3
    Try `.orderByChild('is_supervisor').startAt('')`, that should get all of the values. Oh wait... you want nodes without (a value for) this property. It looks like this should be possible: https://stackoverflow.com/questions/39195191/firebase-query-to-exclude-data-based-on-a-condition/39195551#39195551 – Frank van Puffelen Nov 28 '18 at 15:28
  • 2
    What's wrong with `return this.angularFireDataBase.database.ref().child('users/').orderByChild('is_supervisor').equalTo(null);`? – Jake Lee Nov 28 '18 at 15:33

0 Answers0