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 "-LNVBiM1SGoAFvlMfi1V", and I need to retrieve with it all the orders objects where this key is found (04TBR7 in this example).
I know the database structure might not be perfect but there is no possibility to modify it for now.
I tried the following code but it is not right, I guess the equalTo
is not working since it is an Object:
db.ref('/orders').orderByChild('sensors').equalTo(sensor_id).once('value', snapshot => {
// my snapshot is always empty ...
});