I'm novice with firebase and I try to structure my data to store friendship between users of my app.
My data are structured like this :
{ users: {
user_1: {
name: John
},
user_2: {
name: Jack
},
user_3: {
name: Georges
},
},
{ friendships : {
user_1 : {
user_2: {
name: Jack
},
user_3: {
name: Georges
},
user_3: {
user_1: {
name: John
},
user_2: {
name: Jack
}
}
}
I don't know if my data structure is OK, but I wonder what is the best way to update a name in the friendships if a user changes his name, how can I easily update the reference in the friendships (brows each node ?) ?
Thank you if someone can help me to understand the right way to do that.
A.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…