首页 > 解决方案 > Firebase cloudstore在flutter中获取文档中的所有集合

问题描述

当我不知道集合的名称时,我将获取文档中的所有集合,如何获取文档中的所有集合

await FirebaseFirestore.instance
    .collection('answers')
    .doc('vS55vOUPtNXaRY06IXIPq6V9ss73')
    .collection('uu')
    .get()
    .then((querySnapshot) {      

}).catchError((e){

});

Doument "vS55vOUPtNXaRY06IXIPq6V9ss73" 有 2 个集合,"uu" 和 "uy"。这是动态的。

在此处输入图像描述

标签: firebasefluttergoogle-cloud-firestore

解决方案


Firestore.instance.collection("answers").snapshots这可用于检索 firestore 中的所有文档


推荐阅读