当社のデータベース構造は以下のようになります。私たちは、ドキュメントからの読み取りのためのいくつかのルールを作成しようとしましたFirestoreセキュリティルール、ネストされたフィールド
trips
12345
toArea
radius: 150
name: "citycenter"
54321
toArea
radius: 250
name: "main street"
:それは
match /chats/{trip} {
match /messages/{message} {
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 != 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
私は本当に何が間違っているのか分かりません。逆の2つのルール(== null /!= null)はどうやって動作しませんか?どのように我々はフィールドでtoArea.radiusのルールで管理できますか?
try '.data.toArea.data.radius' – Hareesh
現在、ルールのネストされたプロパティに問題があります。これはほとんど間違いではありません。私たちは可能な限り迅速に修正プログラムを公開しています。ご理解いただきありがとうございます。 –
それは一貫して '.data.field.data'ですか? – iiylll