This is a copy of the question here: Querying in Firebase by child of child
There are two answers which are identical but neither of them actually work. I would simply respond to the answers but I don't have the reputation to do that - so I need to ask another question (stackOverflow failure - I can flood the website with multiples but I can't tell someone their answer doesn't work!?!)
I am working on a Firebase app that uses groups. Each group is structured like this
groups : {
"-KW5C5pS_OsWqS8_SLDy" : {
"key" : "-KW5C5pS_OsWqS8_SLDy",
"name" : "Test",
"users" : {
"uFpUrVFafVgVFsQudTNpOquIJZE2" : true
}
}
}
I would like to be able to query for groups that have the current users uid with either true or false indicating if they have admin rights or not. Right now my query looks like this:
FIRDatabase.database().reference()
.child("groups").queryOrdered(byChild: "users/" + uid).queryEqual(toValue: writable)
This is identical to what was posted as an answer to the other question and stated over and over that it works - however it returns nothing!
Is this a bug or am I doing something wrong?