[英]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.