title: Firebase adding new child under certain unique push ID
body: <p>I am trying to achieve this:</p>
  
  <pre><code>households {
      householdID1 : {
          address : "BLK 16, Woodlands Street"
          accounts : {
              accountID1 : true,
              accountID2 : true,
          }
      }
  }
  </code></pre>
  
  <p>But when I tried to insert, it becomes like this:</p>
  
  <p><a href="https://i.stack.imgur.com/QzWVC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QzWVC.png" alt="enter image description here"></a></p>
  
  <p>Here is my code:</p>
  
  <pre><code> var householdRef = firebase.database().ref('households');
  
  var householdData = {
      address : "Blk 164"
  }
  
  householdRef.push(householdData);
  var householdKey = householdRef.key;
  console.log(householdKey);
  
  var query = firebase.database().ref('accounts').orderByChild('email').equalTo('gab@gmail.com');
  query.once( 'value', data =&gt; {
      data.forEach(userSnapshot =&gt; {
          let userKey = userSnapshot.key;
          console.log('userKey ' + userKey);
  
          firebase.database().ref('households').child(householdKey).child('accounts').push().set({
            userKey : true,
          }), (error) =&gt; {
            if (error) {
              console.log(error.message);
            }else{
              // Success
            }
          }
      });
  });
  </code></pre>
  
  <p>After I obtained the householdKey, I tried to add new nested child under that particular householdKey child. I first loop thru accounts record to find the unique ID for account, then I proceed to add. But it ends up become like this picture above. Any ideas?</p>