title: How can I get all the child nodes from a parent node in Firebase?
body: <p>So I'm intending of retrieving a list of nodes from the parent node <code>societies</code> which will store the child node names, retrieved from this case being <code>ALT5</code> , <code>ASN11</code> , <code>Foot15</code></p>
  
  <p><a href="https://i.stack.imgur.com/Ubb63.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ubb63.jpg" alt="Screenshot of firebase"></a></p>
  
  <p>The <code>child</code> node directly beneath <code>sUsers</code> is the <code>uid</code> of that user so it can be retrieved using 
  <code>var runUid = firebase.auth().currentUser.uid;</code> so that the query can work with multiple users with different <code>child</code> nodes</p>
  
  <p>EDIT : This needs to work on other nodes within <code>sUsers</code> that will have different child nodes under <code>Societies</code></p>
  
  <p>code so far, currently because there are 3 child nodes under <code>societies</code> it will log 3 <code>null</code> values, whereas I want the actual names of the <code>child</code> nodes stored</p>
  
  <pre><code>    firebase.auth().onAuthStateChanged(function(user){
     var userID = firebase.auth().currentUser.uid;
     var rootRef = firebase.database().ref('sUsers');
     var newRoot = rootRef.child(userID).child('Societies')
      newRoot.once('value', function(snapshot){
          snapshot.forEach(function(childs){
              var societies = childs.child('Societies').val();
              console.log(societies);
  
          });
      });
  });
  </code></pre>