Reputation: 2202
I have the following data structure
where count is any integer, I made the following security rule to allow adding users only if the count value is less than for example 5
"users": {
".read": true,
".write": "root.child('counter').child('count').val() < 5"
}
but it shows me permission denied. Any other suggestions to access a child of sibling nodes?
Upvotes: 0
Views: 267
Reputation: 598728
I think you're looking for:
newData.parent().child('counter')...
instead of root.child('counter')
. The difference is that newData
contains the... new data.
Upvotes: 2