title: How to query firebase keys with a substring
body: <p>I want to query Firebase that contains an input. for example in the database structure below, I would like to query all nodes that contains "4140" 
  so I use this code</p>
  
  <p><a href="https://i.stack.imgur.com/8YzGM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8YzGM.png" alt="enter image description here"></a></p>
  
  <pre><code>  var catref = Cataloguedatabase.ref("/Listing Search/");
  
  
      return catref.once('value').then(function(snapshot){
      snapshot.forEach(childSnapshot =&gt; { 
  
      let snapdb = childSnapshot.val();
      let key = childSnapshot.key;
      //use ES6 includes function
      if(key.includes(schname)){  
  
      console.log(childSnapshot.val());
      var searchresults = childSnapshot.val();
      var container = document.getElementById('listing_gallery');
                        // container.innerHTML = '';
  
      var productCard = `
          &lt;div class="col-sm-3"&gt;
          &lt;div class="card" onclick="gotoproduct(this);" id="${key}"&gt;
                                `
           container.innerHTML += productCard;
                      }
                  })
                })
  </code></pre>
  
  <p>This works but the problem is that it first query all the child and sort through the array.This is ok for node with few children but when it gets to thousands of children, it becomes impractical. is there a away i can only query key the contains the value in firebase and if not how else can i implement this?</p>