Firestore查询arrayContains不起作用-返回空的DocumentList

时间:2020-04-02 08:51:19

标签: firebase flutter firebase-realtime-database dart google-cloud-firestore

 QuerySnapshot snapshot = await Firestore.instance
              .collection("test")
              .where("name", arrayContains: "B")
              .limit(5)
              .getDocuments();
      var documentList = snapshot.documents;
      print(documentList);
      searchList = documentList;
      searchList.forEach((res) {
        print(res.data['name']);
      });

DocumentList是一个空数组。 数据在数据库中的外观如下。

enter image description here

0 个答案:

没有答案