Firebase multiple WHERE clause in query
<p>I'm trying to retreive data where flight data is returned only when the arrival date and airport match. I can't seem to figure out the best solution for this. I can only pull data where either the airport or arrival date is the same, not both (can only use <code>equalTo()</code> once). Here is what my current java code looks like:</p>

<pre><code>Firebase ref = mFirebaseRef.child(FirebaseReference.CHILD_FLIGHTS);

Query queryRef = ref.orderByChild("airport").equalTo(getAirport());

queryRef.addListenerForSingleValueEvent(new ValueEventListener() {
    @Override
    public void onDataChange(DataSnapshot dataSnapshot) {
        System.out.println(TAG + " datasnapshot is equal to " + dataSnapshot);
    }
}
</code></pre>

<p>Here's the data itself:</p>

<pre><code>{
   "flight":{
      "1ddf3c02-1f2e-4eb7-93d8-3d8d4f9e3da2":{
         "airport":"Gothenburg, Sweden - Landvetter (GOT)",
         "arrivalDate":"2016-06-21",
         "arrivalTime":"20:58",
         "code":"GOT",
         "departureDate":"2016-06-23",
         "departureTime":"20:58"
      },
      "c2c86e54-b4d0-4d83-934b-775a86f0a16c":{
         "airport":"Gothenburg, Sweden - Landvetter (GOT)",
         "arrivalDate":"2016-06-21",
         "arrivalTime":"20:50",
         "code":"GOT",
         "departureDate":"2016-06-23",
         "departureTime":"20:50"
      }
   },
   "users":{
      "1ddf3c02-1f2e-4eb7-93d8-3d8d4f9e3da2":{
         "age":"25",
         "createdTime":"1466533088358",
         "email":"test2@test.com",
         "provider":"password",
         "sex":"M",
         "username":"user2"
      },
      "c2c86e54-b4d0-4d83-934b-775a86f0a16c":{
         "age":"25",
         "createdTime":"1466374588255",
         "email":"test1@test.com",
         "provider":"password",
         "sex":"M",
         "username":"user1"
      }
   }
}
</code></pre>

<p>The current java code will return all children which <strong>only</strong> have the same airport. As you could guess, this isn't feasible when the amount of data which will need to be sorted client side is much larger than the above test data. How can I better filter the data on firebase's end?</p>