title: How to set userName in front of UserId (at top parent key)
body: <p>OK, In Firebase database structure, we have <strong>key</strong> and its <strong>value</strong>. </p>
  
  <p>On user's registration I am storing three main things, First <strong>Email</strong>, Second <strong>Username</strong>, and third <strong>Phone Number</strong>. For now I am storing these three things under unique <strong>userId</strong> generated by Firebase automatically.</p>
  
  <p>The code I am using for this, is given below-</p>
  
  <pre><code>var uid = firebase.auth().currentUser.uid;
  firebase.database().ref().child(uid).set({
  
      email: user.email,
      userName: user_Name,
      phoneNumber: phone_Number_Of_TheUser
    });
  </code></pre>
  
  <p>I want to set the <strong>UserName</strong> in front of <strong>userId</strong>.</p>
  
  <p><strong>IN FRONT OF USER ID</strong> mean, if I am storing UserId as the top parent key, then I want to set the <strong>userName</strong> as its value</p>
  
  <p><a href="https://i.stack.imgur.com/Cxp8g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cxp8g.png" alt="This Image Describes the model of data structure I want to use in Firebase"></a></p>