我的火力數據庫看起來像這樣火力地堡規則來讀取父節點比葉/子節點
"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",
}
}
我使用REST API來檢索火力點的數據。 RESTAPI URL看起來像https://domain.firebaseio.com/students.json?orderby=「標誌/總」 & startAt = 400
我已經通過火力規則索引學生總。我得到的結果以及額外的數據,如名稱,班級,卷號。
我所要的輸出是
"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",
}
}
反正通過RESTAPI或規則來做到這一點。
有沒有被讀取,我們可以定義哪些節點的任何規則,例如
{
"users":{
"students":{
".read" : ["$firebaseKey/Marks"],
".write" : true,
}
}
,這樣我可以使用REST API來從父節點所需的值。
任何其他建議,這將是美好的。
在此先感謝
我不明白你想在這裏完成什麼。你可以編輯你的問題來顯示:1)你想要做的REST調用,2)該位置的JSON(作爲文本),3)你想從調用返回的結果? –
我已編輯上述問題。 – Prags
這不是規則的有效語法:''.read「:[」$ firebaseKey/Marks「]'。 –