Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Firebase firestore安全性的通配符变量未按预期工作_Firebase_Google Cloud Firestore_Firebase Security - Fatal编程技术网

Firebase firestore安全性的通配符变量未按预期工作

Firebase firestore安全性的通配符变量未按预期工作,firebase,google-cloud-firestore,firebase-security,Firebase,Google Cloud Firestore,Firebase Security,这是基本的安全规则 rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { match /patients/{patientId} { allow read: if request.auth.uid == patientId; } } } 我传递的auth.uid与patients集合中已经存在的auth.uid相同。但是firestore

这是基本的安全规则

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {

    match /patients/{patientId} {
      allow read: if request.auth.uid == patientId;
    }
  }
}

我传递的auth.uid与patients集合中已经存在的auth.uid相同。但是firestore安全仿真器拒绝此规则,因为request.auth.uid与patientId不匹配。Patient id通配符变量返回的“{patientId}”与我在auth.uid中传递的文档id字符串不匹配

请编辑问题以显示发出请求的应用程序代码。没有这些,wek就看不出你是否做错了什么。确保显示准确的值,以便我们准确地知道此处使用的值。