So I'm stuck for half a day here, I'm trying to get all the subjects of Arya but I'm having a hard time doing it.
Here's the sample structure in Firebase.
-Subjects
-math
id: 1
name: Math
-students
-Arya
id: 1
name: Arya
-JonSnow
id: 2
name: JonSnow
+justsomename
+science
+english
+history
+computer
Then I found this one Querying in Firebase by child of child.
I tried this
ref.queryOrdered(byChild: "students/name").queryEqual(toValue: "Arya").observeSingleEvent(of: .value, with: { snapshot in
print(snapshot)
})
ref == Subjects
but this is the return
Snap (subjects) <null>
Is the query correct and I'm just doing something wrong?