0

I have structure like that :

users ->
    userId1 ->
        info -> 
           userPhone :11111
    userId2 -> 
        info ->
            userPhone : 22222

How can i query on userPhone with this architecture

Karim Ata
  • 343
  • 6
  • 15
  • @RobertHarvey: I think this may be a different question. The property to search on is nested at a fixed path under `info`, which is possible, but requires some additional syntax for searching. Typically `ref.orderByChild("info/userPhone").equalTo("22222")`. See https://stackoverflow.com/questions/43929230/query-nested-data-from-firebase-real-time-database-android – Frank van Puffelen Jan 12 '19 at 14:53
  • @FrankvanPuffelen thanks for your answer – Karim Ata Jan 12 '19 at 15:17
  • @RobertHarvey try to understand the question first, it's different question!! – Karim Ata Jan 12 '19 at 15:18
  • Does [this post](https://stackoverflow.com/questions/43929230/query-nested-data-from-firebase-real-time-database-android) answer it? `DatabaseReference root = database.getReference().child("Eventos").child("participantes");` – Robert Harvey Jan 12 '19 at 15:19
  • @RobertHarvey yes, this : ref.orderByChild("info/userPhone").equalTo("22222") worked for me – Karim Ata Jan 12 '19 at 16:00

0 Answers0