Get all from a Firestore collection in Flutter

后端 未结 4 799
一整个雨季
一整个雨季 2020-12-08 16:28

I set up Firestore in my project. I created new collection named categories. In this collection I created three documents with uniq id. Now I want to get this c

4条回答
  •  甜味超标
    2020-12-08 17:07

    QuerySnapshot snap = await 
        Firestore.instance.collection('collection').getDocuments();
    
    snap.documents.forEach((document) {
        print(document.documentID);
      });
    

提交回复
热议问题