title: firebase query on the second/third level
body: <p>I am using Javascript with Firebase and I want to make a query on a value exist on the second or the third level, My DB is like that :</p>
  
  <pre><code>Users :
          -KNwBd5cF6iY9dWh0eFd :
                  name: "Jon Snow"
                  phones:
                      phone1: "0123456789"
                      phone2: "0123456987"
  </code></pre>
  
  <p>And I want to make a query on the <code>phone1</code> value, I am using <code>orderByChild</code> to query the DB for now and my code is :</p>
  
  <pre><code>var ref = firebase.database().ref("users");
  ref.orderByChild("name").equalTo("Jon Snow").on("value", function(snapshot) {
      console.log(snapshot.val());
  });
  </code></pre>
  
  <p>But I can only use it to query on the value of the first level of values but how to make another query on the second or third level.</p>