有没有办法使用 Flutter 在 Firestore 中读取嵌套集合?我有以下数据结构
Users:
- userId:
- name: value,
- surname: value;
- addresses:
- addressId:
- street:value,
- city: value
我可以使用以下代码阅读第一个集合:
Firestore.instance.collection("users").document("userId")
.snapshots().listen((snapShot) {});
有没有办法让我从上面的代码中访问地址,或者我必须运行另一个直接获取地址的命令,如下所示:
Firestore.instance.collection("users").document("userId").
collections("addresses").snapshots().listen((snapShot) {});