简体   繁体   English

从 Firestore 中检索数据 - Firebase - Flutter

[英]Retrieve data from a firestore - Firebase - Flutter

i am having a problem retrieving data from my firestore application .. i have a map of map of strings in each document of the Snapshot and i don't know how to retrieve it .. i tried to search but found nothing ..我在从我的 firestore 应用程序中检索数据时遇到问题.. 我在快照的每个文档中有一个字符串映射图,但我不知道如何检索它.. 我试图搜索但什么也没找到..

can anyone help ?!有人可以帮忙吗?!

i can't post images so here it is link for the hierarchy of the data base我不能发布图片,所以这里是数据库层次结构的链接

https://drive.google.com/open?id=1tmNrg3Ce6WBv5XIlARPSVKCiK_dkawnr https://drive.google.com/open?id=1tmNrg3Ce6WBv5XIlARPSVKCiK_dkawnr

在此处输入图片说明

You can either use DataCollection and let the FireStore handle the ID or for this particular problem .. if we assumed you had a QuerySnapshot snapshot您可以使用 DataCollection 并让 FireStore 处理 ID 或针对此特定问题.. 如果我们假设您有一个 QuerySnapshot 快照

snapshot.documents.forEach((doc){
  doc.data.forEach((k,v)//at which k is key and v is value 
  {
    print('${k}: ${v}');
    object obj = new object();
    obj.setObj(v['1'] ?? '',v['2'] ?? '',v['3'] ??'');
    objectList.add(obj);
  });
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM