0
如何寫.indexOn
火力地堡和Android的代碼示例
(問題 - > PushId - >喜歡 - > UserUID)如何書寫.indexOn?
{
"Question" : {
"-Kt6vXlTii19eBkKa4Wr" : {
"Likes" : {
"bEYW6usk5rNo5WT1tdkiBZIv1TN2" : true,
"20Wioh8McfOeZWnn3dfVsRlQ25M2" : true
},
"answer_count" : 0,
"description" : "ds",
"image" : "aa",
"sender_uid" : "bEYW6usk5rNo5WT1tdkiBZIv1TN2",
"time" : 1504445344214
}
},
"Users" : {
"20Wioh8McfOeZWnn3dfVsRlQ25M2" : {
"image" : "image",
"mail" : "mail",
"name" : "image"
},
"bEYW6usk5rNo5WT1tdkiBZIv1TN2" : {
"image" : "image",
"mail" : "mail",
"name" : "image"
}
}
}
這是我的規則,但不能正常工作
{
"rules": {
"Question": {
".read": "auth != null",
".write": "auth != null",
".indexOn": ["sender_uid","Likes"],
},
"Users": {
".read": "auth != null",
"$uid": {
".write": "$uid === auth.uid",
}
}
}
}
請具體說明什麼是不工作。 –
我不知道錯誤的結果總是爲空 – Ekrem
從標題中刪除標籤;佈局。 – Cerbrus