I have this structure:
conversations:
-439f6b3c0958:
-messages:...
-users:
-ccb756c0:
-userId: ccb756c0
...
I'm trying to query the conversations by userId
inside of the conversation/{someid}/users node
Firebase sdk is giving me this warning and its very bad for performance
Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding '".indexOn": "users/ccb756c0/userId"' at conversations to your security and Firebase Database rules for better performance
I added this rule but it didn't solve the problem
"conversations": {
"$conversationId":{
"users" :{
"$uid":{
"userId": {".indexOn": ".value"}
}
}
}
}
I also tried this with no luck:
"conversations": {
"$conversationId":{
"users" :{
"$uid":{
".indexOn": "userId"
}
}
}
}
Who shouldI write this rule to match the structure i'm using?