【发布时间】:2020-11-05 06:17:51
【问题描述】:
当您进入帖子集合时,会有基于 userId 的文档。在文档内部有一个名为 userPosts 的新集合。在用户帖子中,您可以找到 postId 和有关帖子的详细信息。
我可以使用此代码获取特定用户的帖子
postRef = Firestore.instance.collection('posts');
QuerySnapshot snapshot = await postRef
.document(userId)
.collection('userPosts')
.getDocuments();
但我想在不指定特定用户的情况下获取所有用户帖子。我怎样才能做到这一点?
【问题讨论】:
标签: firebase flutter google-cloud-firestore