David Seek David Seek - 3 months ago 23
iOS Question

How to set Firebase rules / [FirebaseDatabase] Using an unspecified index

My rules are:

{
"rules": {
".read": true,
".write": true,
"Recent": {
".indexOn": ["userID", "chatRoomID"]
}
}
}


Still I'm getting:


[FirebaseDatabase] Using an unspecified index. Consider adding
".indexOn": "chatroomID" at /Recent to your security rules for better
performance


How do I have to set it properly? I have tried the last 20 minutes, but can't get is right. Help is very appreciated.

Answer

Your rules say ".indexOn": ["userID", "chatRoomID"] but your error says chatroomID.

chatroomID is not the same as chatRoomID.