react native - Firebase - Saving data -


i have question regarding firebase.

i'm developing app there 3 screens: 'registration screen' user create account email , password. 'building profile screen', user answer questions implemented in profile, (such "what's name?"). , 'profile screen', user information displayed, such user name.

on 'registration screen' i'm having no problem, user fills in email input , password input, , clicking "create account", calling .createuserwithemailandpassword, user account created , taken 'building profile screen'. question i'm having in 'building profile screen'. question is: how can save user name , other data? read articles on subject had difficulty understanding. can of guys me this?

you're going want create node or multiple nodes in firebase each user hold user-specific information. database structure uniform so:

users: {   uid_a: {     username: 'uid_as_username',     email: 'uid_as_email',     name: 'uid_as_name',     other_attribute: 'uid_as_other_attribute_value'     [,...]   },   uid_b: {     username: 'uid_bs_username',     email: 'uid_bs_email',     name: 'uid_bs_name',     other_attribute: 'uid_bs_other_attribute_value'     [,...]   }   [,...] } 

or split so:

usernames: {   uid_a: 'uid_as_username',   uid_b: 'uid_bs_username'   [,...] }, emails: {   uid_a: 'uid_as_email',   uid_b: 'uid_bs_email'   [,...] }, names: {   uid_a: 'uid_as_name',   uid_b: 'uid_bs_name'   [,...] }, other_attribute: {   uid_a: 'uid_as_other_attribute_value',   uid_b: 'uid_bs_other_attribute_value'   [,...] } 

which choose design choice, thats idea.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -