【发布时间】:2021-05-27 15:48:38
【问题描述】:
我使用带有 Flutter 的 Cloud Firestore,我成功地从文档中获取了所有键/值,但我没有成功匹配文档中的一个 id
这是我的代码:
getgift() async {
final firestoreInstance = FirebaseFirestore.instance;
// Get docs from collection reference
QuerySnapshot querySnapshot = await firestoreInstance.collection("parrainage").get();
// Get data from docs and convert map to List
final mydata= querySnapshot.docs.map((doc) => doc.data()).toString();
print("$mydata");
我当前的输出是({key1: value1}, {key2: value2})
对于这个例子,我尝试只匹配来自 key1 的数据。
谢谢 }
【问题讨论】:
标签: flutter google-cloud-firestore