My firebase database looks like this
"students" : {
"firebase_key_1" : {
"Name" : "blah blah",
"Address" : "blah blah",
"Roll No" : "blah blah",
"Marks" : {
"Sub1" : "blah",
"Sub2" : "blah",
"Sub3" : "blah",
"Total" : "Total",
},
"class" : "blah blah",
"Transportation" : "blah blah",
"Department" : "blah blah",
},
"firebase_key_2" : {
"Name" : "blah blah",
"Address" : "blah blah",
"Roll No" : "blah blah",
"Marks" : {
"Sub1" : "blah",
"Sub2" : "blah",
"Sub3" : "blah",
"Total" : "Total",
},
"class" : "blah blah",
"Transportation" : "blah blah",
"Department" : "blah blah",
},
"firebase_key_3" : {
"Name" : "blah blah",
"Address" : "blah blah",
"Roll No" : "blah blah",
"Marks" : {
"Sub1" : "blah",
"Sub2" : "blah",
"Sub3" : "blah",
"Total" : "Total",
},
"class" : "blah blah",
"Transportation" : "blah blah",
"Department" : "blah blah",
}
}
I am using rest api to retrieve the data from firebase. Restapi url looks like https://domain.firebaseio.com/students.json?orderby="Marks/Total"&startAt=400
I have already indexed the Total in students via firebase rules. I am getting Result along with extra data such as name, class, roll no.
I want the output to be
"firebase_key_1" : {
"Marks" : {
"Sub1" : "blah",
"Sub2" : "blah",
"Sub3" : "blah",
"Total" : "Total",
}
},
"firebase_key_2" : {
"Marks" : {
"Sub1" : "blah",
"Sub2" : "blah",
"Sub3" : "blah",
"Total" : "Total",
}
},
"firebase_key_3" : {
"Marks" : {
"Sub1" : "blah",
"Sub2" : "blah",
"Sub3" : "blah",
"Total" : "Total",
}
}
Is there anyway to do this via RestAPi or Rules.
Is there any rules that we can define what nodes to be read for example
{
"users":{
"students":{
".read" : ["$firebaseKey/Marks"],
".write" : true,
}
}
So that i can use Rest api to retrieve the required values from parent node.
Any other suggestion to do this will be wonderful.
Thanks in Advance