title: Firebase orderByChild not working in my Database
body: <p>I have a firebase database at this structure</p>
  <pre><code>DATA: { 
   DATE: {
    KEY: {
       NAME: &quot;&quot;,
       AGE: &quot;&quot;.
       ADDRESS: &quot;&quot;
       }
    } 
  }
  </code></pre>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    var ref = database.ref('DATA');
      ref.orderByChild('AGE').equalTo(AGE).on('child_added',
      function (snapshot) {
        console.log(snapshot.val());
            if (snapshot.exists()) {
              var content = '';
              snapshot.forEach(function (data) {
                   var val = data.val();
                   console.log(data.val());
                   content += '&lt;tr&gt;';
  
                   if (val.AGE) {
                        content += '&lt;td&gt;&lt;strong&gt;' + val.AGE + '&lt;/strong&gt;&lt;/td&gt;';
                        } else {
                        content += '&lt;td&gt;-&lt;/td&gt;';
                        }</code></pre>
  </div>
  </div>
  </p>
  <p>I tried to console log the snapshot.val but it shows null. How can I do this?
  Thank you.</p>