title: Firebase get grandparent object from grandchild key
body: <p>I try to retrieve all the grand parent objects when a grandchild key is matched. In the Firebase realtime database below, I have for example the sensor key &quot;-LNVBiM1SGoAFvlMfi1V&quot;, and I need to retrieve with it all the orders objects where this key is found (04TBR7 in this example).</p>
  <p>I know the database structure might not be perfect but there is no possibility to modify it for now.</p>
  <p>I tried the following code but it is not right, I guess the <code>equalTo</code> is not working since it is an Object:</p>
  <pre><code>db.ref('/orders').orderByChild('sensors').equalTo(sensor_id).once('value', snapshot =&gt; {
  // my snapshot is always empty ...
  });
  </code></pre>
  <p><a href="https://i.stack.imgur.com/SKWUU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SKWUU.png" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/dHecr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dHecr.png" alt="enter image description here" /></a></p>