0
我有这样的数据结构火力地堡数据结构的建议
{
"post": {
"<postID>": {
"postUserID": "<--uid-->",
"postUserName": "Nicholas",
"postUserIMG": "http://firebase.....",
"postImage": "http://firebase.....",
"Topic": "It is a nice day",
"like": "0"
}
},
"user": {
"<--uid-->": {
"username": "Nicholas",
"profilePic": "http://firebase.....",
"post": "<postID>"
}
}
}
它工作得很好,但是我得到的数据后的一些问题。如果我更改了用户数据(例如:用户名),我需要更改用户的所有发布数据。我认为这种结构根本没有效率。如何重构数据结构以便它可以仅更改一次用户数据。
我试过了,但它不工作,因为我在表视图中显示结构'Post'的帖子。我怎么能这样做? –
您必须查询每个用户并将其存储在另一个变量中。 –