Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.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 Platform_Google Cloud Firestore_Firebase Security - Fatal编程技术网

Firebase Firestore安全规则。允许读取完整集合(文档和子集合)

Firebase Firestore安全规则。允许读取完整集合(文档和子集合),firebase,google-cloud-platform,google-cloud-firestore,firebase-security,Firebase,Google Cloud Platform,Google Cloud Firestore,Firebase Security,我一直在尝试使用以下安全规则使子集合中的所有文档完全可读: match /books { allow write, update, delete: if false; // This collection cannot be modified match /sells { allow read: if true; // All documents and sub-collections of this collection are readable

我一直在尝试使用以下安全规则使子集合中的所有文档完全可读:

 match /books {
     allow write, update, delete: if false; // This collection cannot be modified
  
     match /sells {
         allow read: if true; // All documents and sub-collections of this collection are readable
     }
 }
但是,当我尝试读取sell子集合的文档时,我得到了Firebase权限错误。我做错了什么?

您需要:


如果您还想匹配
销售
文档的子集合,可以使用如下方法:

 match /sells/{doc=**} {
     allow read: if true; // All documents in and sub-collections of sells are readable
 }
 match /sells/{doc=**} {
     allow read: if true; // All documents in and sub-collections of sells are readable
 }