1

I need to query a Firebase list based on two keys and values. For example:

books
   -gdhagd342363
        status:'Active'
        authers
            -yruywert676:'john markos'
            -eiuqwbj8200:'mark solo'
   -jdfhs8797429
        status:'Active'
        authers
            -yruywert676:'john markos'

So I want to find how many books are (status=='Active') AND (the key of the authers child == -yruywert676).

How to implement such query ?

AL.
  • 36,815
  • 10
  • 142
  • 281
devMan
  • 89
  • 2
  • 14
  • Firebase Database queries can only order/filter on a single property. In some cases it may be possible to combine multiple values into a single property to accomplish a use-case (see [this answer](http://stackoverflow.com/questions/26700924/query-based-on-multiple-where-clauses-in-firebase)). But it looks like this scenario is closer to putting the books into categories (see [this answer](http://stackoverflow.com/questions/40656589/firebase-query-if-child-of-child-contains-a-value)). – Frank van Puffelen Feb 15 '17 at 23:00
  • In addition to Frank's comment, I'd recommend you read https://firebase.google.com/docs/database/web/structure-data – shusson Feb 16 '17 at 00:20

0 Answers0