![](/img/trans.png)
[英]Flutter : How to get the length of field (list) in Firestore document?
[英]Flutter firestore query on document array field
我有这个firestore数据库。
有一个包含用户文档的“用户”集合。 每个用户都有自己的信息,例如姓名和购物车。 我想在 stream 中获取特定用户的所有“购物车”。 您将如何查询 go?
await FirebaseFirestore.instance.Collection("users").doc("docIdHere").get().then((.
document) {
//it will get the first item in the cart with index zero
document.get("cart")[0];
//then do what you want
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.