![](/img/trans.png)
[英]How to get a list of document IDs in a collection Cloud Firestore?
[英]How to get document ids of a firestore collection
使用getDocuments()方法,您将获得querysnapshot。 使用.documents获取DocumentSnapshot。 循环打印其documentId。
QuerySnapshot querySnapshot = await Firestore.instance.collection("RecodeBook").getDocuments();
var list = querySnapshot.documents;
list.forEach((f) {
print(f.documentID);
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.