android - 在firestore中监听多个文档,它的ids存储在一个数组中
问题描述
我正在使用 Firestore 为电子商务构建一个购物车。下载购物车文档,并将产品 ID 存储在数组中。现在我想听这些产品文档的价格、数量等数据变化。
我的firestore数据库设计如下。
-ProductCollection
-{product_id}
document
|-name
|-price
|-availableSizes
| -1
| -name
| -quantityAvailable
| -2
| -name
| -quantityAvailable
-CartCollection
-{cart_id}
document
|-ItemList
| -{product_id}
| -size
| -quntityNeeded
| -size
| -quntityNeeded
| -{product_id}
| -size
| -quntityNeeded
| -size
| -quntityNeeded
解决方案
推荐阅读
- python - 为什么在 Windows 上安装 MXNET 的 pip 命令无法正常工作/安装不正确?
- node.js - 我正在尝试测试 node.js
- sql - CTE 多连接
- c++ - 更新具有空值的 uniqueidentifier 列时出现 ODBC 错误“字符串数据,右截断”
- typo3 - 如何从typo3循环ObjectStorage项目
- swift - 为什么我的 macOS 应用程序绕过沙盒文件访问?
- r - 从 5 开始(续)
- python - 如何计算多级索引分组的百分比?
- qt - QGridLayout 插入 qwidget
- c - 结构类型的返回类型上的“delete_node”的错误类型冲突