Our database structure looks like that:
trips
12345
toArea
radius: 150
name: "citycenter"
54321
toArea
radius: 250
name: "main street"
We tried to create some rules for read from document:
match /chats/{trip} {
match /messages/{message} {
allow read, write: if get(/databases/$(database)/documents/trips/$(trip)).data.toArea != null
}
}
It's works fine
but next rules doesn't works:
allow read, write: if get(/databases/$(database)/documents/trips/$(trip)).data.toArea != null
allow read, write: if get(/databases/$(database)/documents/trips/$(trip)).data.toArea.radius != null
allow read, write: if get(/databases/$(database)/documents/trips/$(trip)).data.toArea.radius == null
allow read, write: if get(/databases/$(database)/documents/trips/$(trip)).data.toArea["radius"] == null
allow read, write: if get(/databases/$(database)/documents/trips/$(trip)).data.toArea["radius"] != null
allow read, write: if get(/databases/$(database)/documents/trips/$(trip)).data["toArea.radius"] == null
allow read, write: if get(/databases/$(database)/documents/trips/$(trip)).data["toArea.radius"] != null
I really don't understand what wrong with it, how could two opposite rules (==null / != null) doesn't work. How could we manage with fields toArea.radius in rules?
.data.toArea.data.radius- Hareesh.data.field.dataconsistently? - dubace