1)构建数据库是否更好:
blogapp
-User
id
name
...
-Post
id
users
-a unique id
-userId
-contentOfPost
2)为UserPost使用单独的节点
blogapp
-User
...
-Post
-UserPost
-unique id
-userId
-PostId
谢谢
答案 0 :(得分:2)
是使用单独的UserPost
:
Users
userid
name: userx
email: userx@gmail.com
userid1
name:usery
email: usery@gmail.com
UserPost
userid
author:userx
postcontent: content_here
posttitle: title_here
userid1
author: usery
postcontent: content_here
posttitle: title_here
更多信息:
https://firebase.googleblog.com/2013/04/denormalizing-your-data-is-normal.html