Firebase如何更新子级值

时间:2018-06-22 16:15:30

标签: firebase firebase-realtime-database nosql

我的用户有朋友。这些朋友在接受请求时会链接一些数据。数据树看起来像这样;

friends
    [uid] // the users uid
        [uid] // the uid of the friend
            status: 'friends'
            username: 'UserName1'

这是顶层数据,用于快速向用户显示其朋友的姓名,而不是每个人都需要额外的查询来获取姓名。

问题在于更新用户名。如果UserName1要更改其用户名,则这是需要更新的位置之一。其他位置没有那么深的嵌套,因此没有太大的问题。

0 个答案:

没有答案