Bri*_*ton 21

这看起来像是一个文档错误,因为在 Firestore 中您会request.auth.uid在 RTDB 中编写,而您只需编写auth.uid.

{
  "rules": {
    "some_path": {
      "$uid": {
        // Allow only authenticated content owners access to their data
        ".read": "auth != null && auth.uid == $uid",
        ".write": "auth != null && auth.uid == $uid"
      }
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

  • 在 : ".read": "auth != null && auth.uid == $uid" 之后添加逗号 (2认同)