在Firestore中侦听多个文档,其ID存储在数组中

时间:2019-02-21 10:47:16

标签: android firebase google-cloud-firestore

我正在使用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

0 个答案:

没有答案