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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.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_Flutter_Dart_Google Cloud Firestore - Fatal编程技术网

Firebase Firestore查询可以';获取文档

Firebase Firestore查询可以';获取文档,firebase,flutter,dart,google-cloud-firestore,Firebase,Flutter,Dart,Google Cloud Firestore,所以我在一个名为“Authors”的集合中有一个数组。我想检查是否存在某个字符串(邮件),但它表示getDocuments上的权限被拒绝。 这里有一个小片段: List<String> authors; _getAuthors(DocumentSnapshot doc) async { if (await FirebaseAuth.instance.currentUser() != null) { var query = Firestore.instan

所以我在一个名为“Authors”的集合中有一个数组。我想检查是否存在某个字符串(邮件),但它表示getDocuments上的权限被拒绝。 这里有一个小片段:

  List<String> authors;

  _getAuthors(DocumentSnapshot doc) async {
    if (await FirebaseAuth.instance.currentUser() != null) {
      var query = Firestore.instance
          .collection('mealList')
          .where('Authors', arrayContains: mail);
      query.getDocuments().then((value) => print(value));
    }
  }

  Widget buildItem(DocumentSnapshot doc) {
    DateTime now = doc.data['Date'].toDate();
    DateFormat formatter = DateFormat('dd-MM-yyyy');
    String formatted = formatter.format(now);
    _getUserId();
    _getMail(doc);
    if (doc.data['Authors'] != null) {
      _getAuthors(doc);
    }

检查mealList集合的安全规则。它只是阻止授权用户。请检查mealList集合的安全规则。它只是阻止授权用户。
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {

    match /mealList/{uid} {
      allow read, write: if request.auth == null;
    }

    match /shoppingList/{uid} {
      allow read, write: if request.auth != null;
    }
  }
}
   match /mealList/{uid} {
      allow read, write: if request.auth == null;
    }

should be 

   match /mealList/{uid} {
      allow read, write: if request.auth != null;
    }