1

I have this structure :

enter image description here

I'm trying to get all the value corresponding to the tag "Courses" like this :

  FirebaseDatabase.getInstance().getReference().child("Belgique").orderByChild("Tag").equalTo("Courses").addListenerForSingleValueEvent...

EDIT

EXPECTED RESULT :

 "Key2" : {
     "Tag" : {
     "Courses":"ok",
     "Tomate" : "ok"
    }
    }

but it doesn't to work. (The two nodes with the same name "Tag" are not related at all) Would have any tips? Thank you

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
ImNeos
  • 527
  • 6
  • 17
  • 2
    What you're doing would require a query `.orderByChild("Tag/Courses").equalTo(true)`. But the problem is that the query won't scale. I've explained more https://stackoverflow.com/questions/40656589/firebase-query-if-child-of-child-contains-a-value – Frank van Puffelen Apr 13 '20 at 19:48
  • I've read it. Great explanation, thank you. In my case, "John" would be "Courses" and his children would be a list of all the KEY that coutains "Courses". – ImNeos Apr 14 '20 at 10:09

0 Answers0