Bha*_*thi 0 database database-design google-cloud-firestore
这个问题与查询firestore和实现类似系统的最佳方法有关,并且计算firestore中每个帖子的不喜欢.
让我们说我们有收集称为帖子,喜欢,评论,主题标签.其中有json结构.
posts:[{ likes [{
postId:id postId:,
createdAt:date userId,
title:string, collectionType:'posts',
description,string likedAt:date
updatedAt,date }]
createdUser:userId
updatedUser:userId,
}]
comments:[{ hashtags [{}]
postId,
userComments:[{
userId:,
comment:'',
commentedAt:''
replies:[{}]
}]
Run Code Online (Sandbox Code Playgroud)
使用用户注释实现类似系统的最佳方法是什么,以及每个注释的嵌套回复,当我们拥有数百万用户和帖子时,可以提高效率和性能.
查询所有喜欢的帖子,并且喜欢登录用户是否喜欢每个帖子以及评论和评论计数,如果可用则获取每条评论的回复.
这是我的方法适用于firestore吗?或者任何最佳数据建模设计也是可能的.
我们是否需要将哈希标签存储在相同集合的单独集合中,即创建post时,使用hashtags数组内部post对象.
我是firestore的新手,我想学习在firestore中查询数据.根据我对mongodb的了解,我想在火炉店探索.请帮我处理我的问题.任何建议或指导都非常感谢.
谢谢