Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
502 views
in Technique[技术] by (71.8m points)

android - How to structure friendship data with firebase?

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...