簡體   English   中英

Flutter 對文檔數組字段的firestore查詢

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

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM