I have an app, that has Topics and categories, one category may belong to one or more topics, i'm trying to filter the data to only show category that has a certain topic id marked as true, this is the structure:
Here is the code i come up with ( which was working on Swift 2.3 ):
self.ref = FIRDatabase.database().reference(fromURL: FIREBASE_URL).child("categories")
let query = ref?.queryOrdered(byChild: "topics/idt2").queryEqual(toValue: true)
query!.observe(.value, with: { (snapshot) in
//This should bring back both categories, Soccer and Moon
print("Inside query \(snapshot.value)") // Prints null
})
Any ideas?