Firebase docs covers Filtering by a specified child key. But it assumes that the child value is know. It does not cover a situation where the child is a dynamic value (eg : Student Roll Number)
Specified Child Name Example Data
{
"Student1": {
"semister": {
"english" : 80,
"maths" : 60
}
},
"Student2": {
"semister": {
"english" : 40,
"maths" : 45
}
}
}
Get students who have scored marks higher than 50 in maths
[GET] https://<baseurl>/students.json?orderBy="semister/maths"&startAt=50
Dynamic Child Name Example Data
{
"Student1": {
"unit1": {
"english" : 80,
"maths" : 60
},
"unit2": {
"english" : 80,
"maths" : 60
}
},
"Student2": {
"semister": {
"english" : 40,
"maths" : 50
},
"unit2": {
"english" : 80,
"maths" : 60
}
}
}
I get error by using below
Get students who have scored marks higher than 50 in maths in any unit
[GET] https://<baseurl>/students.json?orderBy="$unit/maths"&startAt=50
Any help / suggestion is appreciated