Reputation: 7552
I have these rules
{
"rules": {
"categories": { ".read": true },
"conversations": {
"$key": {
"users": {
".write": true
},
}
},
I tried to post to /conversations/44da/
this data:
{
"users": "value"
}
which works fine with using update method
but set fails
Upvotes: 1
Views: 75
Reputation: 148
When you update, you save the data to the user node. This means searching for rules in the database will find "write true" on line 8.
But when you set a new value, you write in node $ key (44da) (because the user does not exist yet), or even in node "conversations" (in case node 44da does not exist either). The database searches for rules for the conversation of the $ key node or node, but no rules are set there.
Upvotes: 1