title: Javascript, get the autoId from a Firebase child
body: <p>I'm trying to find the autoID which was auto generated by firebase during the save. </p>
  
  <p>my firebase structure is : </p>
  
  <pre><code>-flights
      -userID
          -autoID-1
              -info1
              -info2
              -info3
          -autoID-2
              -info4
              -info5
              -info6
          -autoID-3
              -info7
              -info8
              -info9
          -autoID-4
              -info10
              -info11
              -info12
  </code></pre>
  
  <p>My objectif is to get all the userID informations in a HTML table. </p>
  
  <p>I think I need to read the informations from firebase into a javascript array and then add a new html table line for each new entry in my JS array. </p>
  
  <p>The HTML structure that I want is : </p>
  
  <pre><code>line 1 : INFO 1 / INFO 2 / INFO 3
  line 2 : INFO 4 / INFO 5 / INFO 6 
  line 3 : INFO 7 / INFO 8 / INFO 9
  line 4 : INFO 10 / INFO 11 / INFO 12 
  ...
  </code></pre>
  
  <p>But I totally don't know How to get the informations from firebase with javascript when I use autoID... </p>
  
  <p>for now I try this JS code : </p>
  
  <pre><code>return firebase.database().ref('/flights/' + userId).once('value').then(function(snapshot) {
              var flightKey = (snapshot.val() &amp;&amp; snapshot.val().autoID) || 'NULL';
              alert(flightKey);
          });
  </code></pre>
  
  <p>but nothing happens .... </p>
  
  <p>How can I fix it ? </p>
  
  <p>thanks ! </p>