title: Android firebase query multiple child
body: <p>Hello guys I am trying to select courses which contain student of specific name, it may be because there are multiple students registered on a course, but I still can't solve that issue. (very similar query i.e. for course name works perfectly fine) Data snapshot looks like{key:course,value:null} even though there is course which should satisfy criteria <a href="https://i.stack.imgur.com/V2MMv.png" rel="nofollow noreferrer">Firebase structure</a></p>
  
  <pre><code>   Query query= mDatabase.child("courses").orderByChild("students/name").equalTo("Dominik Skoczylas");
      query.addValueEventListener(new ValueEventListener() {
          @Override
  
          public void onDataChange(DataSnapshot dataSnapshot) {
              if (dataSnapshot.exists()) {
                  for (DataSnapshot child : dataSnapshot.getChildren())
  
                  {
                      userCourse = child.getValue(Course.class);
  
                  }
              }}
          @Override
          public void onCancelled(DatabaseError databaseError) {
  
          }
      });
  
  
  
  
    "courses" : {
  "-Kfo-G37vwtUkWAv1zE_" : {
    "modules" : [ {
      "lectures" : [ {
        "endTime" : {
          "date" : 1,
          "day" : 4,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1517446861000,
          "timezoneOffset" : 0,
          "year" : 118
        },
        "room" : {
          "name" : "J100"
        },
        "starTime" : {
          "date" : 1,
          "day" : 3,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1485910861000,
          "timezoneOffset" : 0,
          "year" : 117
        },
        "topic" : "Distributed 1"
      }, {
        "endTime" : {
          "date" : 1,
          "day" : 4,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1517446861000,
          "timezoneOffset" : 0,
          "year" : 118
        },
        "room" : {
          "name" : "J200"
        },
        "starTime" : {
          "date" : 1,
          "day" : 3,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1485910861000,
          "timezoneOffset" : 0,
          "year" : 117
        },
        "topic" : "Distributed 2"
      } ],
      "name" : "Distributed computing"
    }, {
      "lectures" : [ {
        "endTime" : {
          "date" : 1,
          "day" : 4,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1517446861000,
          "timezoneOffset" : 0,
          "year" : 118
        },
        "room" : {
          "name" : "J100"
        },
        "starTime" : {
          "date" : 1,
          "day" : 3,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1485910861000,
          "timezoneOffset" : 0,
          "year" : 117
        },
        "topic" : "Advanced 1"
      }, {
        "endTime" : {
          "date" : 1,
          "day" : 4,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1517446861000,
          "timezoneOffset" : 0,
          "year" : 118
        },
        "room" : {
          "name" : "J200"
        },
        "starTime" : {
          "date" : 1,
          "day" : 3,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1485910861000,
          "timezoneOffset" : 0,
          "year" : 117
        },
        "topic" : "Advanced 2"
      } ],
      "name" : "Advanced internet"
    }, {
      "lectures" : [ {
        "endTime" : {
          "date" : 1,
          "day" : 4,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1517446861000,
          "timezoneOffset" : 0,
          "year" : 118
        },
        "room" : {
          "name" : "J100"
        },
        "starTime" : {
          "date" : 1,
          "day" : 3,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1485910861000,
          "timezoneOffset" : 0,
          "year" : 117
        },
        "topic" : "Concurrent 1"
      }, {
        "endTime" : {
          "date" : 1,
          "day" : 4,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1517446861000,
          "timezoneOffset" : 0,
          "year" : 118
        },
        "room" : {
          "name" : "J200"
        },
        "starTime" : {
          "date" : 1,
          "day" : 3,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1485910861000,
          "timezoneOffset" : 0,
          "year" : 117
        },
        "topic" : "Concurrent 2"
      } ],
      "name" : "Concurrent programming"
    } ],
    "name" : "Software Engineering",
    "students" : [ {
      "name" : "Dominik Skoczylas"
    }, {
      "name" : "Marta Mleczko"
    }, {
      "name" : "Zenon Zenon"
    }, {
      "name" : "Matt Damon"
    } ]
  },
  "-Kfo-G3G4ndKYpKHhtgV" : {
    "modules" : [ {
      "lectures" : [ {
        "endTime" : {
          "date" : 1,
          "day" : 4,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1517446861000,
          "timezoneOffset" : 0,
          "year" : 118
        },
        "room" : {
          "name" : "J100"
        },
        "starTime" : {
          "date" : 1,
          "day" : 3,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1485910861000,
          "timezoneOffset" : 0,
          "year" : 117
        },
        "topic" : "Concurrent 1"
      }, {
        "endTime" : {
          "date" : 1,
          "day" : 4,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1517446861000,
          "timezoneOffset" : 0,
          "year" : 118
        },
        "room" : {
          "name" : "J200"
        },
        "starTime" : {
          "date" : 1,
          "day" : 3,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1485910861000,
          "timezoneOffset" : 0,
          "year" : 117
        },
        "topic" : "Concurrent 2"
      } ],
      "name" : "Concurrent programming"
    }, {
      "lectures" : [ {
        "endTime" : {
          "date" : 1,
          "day" : 4,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1517446861000,
          "timezoneOffset" : 0,
          "year" : 118
        },
        "room" : {
          "name" : "J100"
        },
        "starTime" : {
          "date" : 1,
          "day" : 3,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1485910861000,
          "timezoneOffset" : 0,
          "year" : 117
        },
        "topic" : "Graphics 1"
      }, {
        "endTime" : {
          "date" : 1,
          "day" : 4,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1517446861000,
          "timezoneOffset" : 0,
          "year" : 118
        },
        "room" : {
          "name" : "J200"
        },
        "starTime" : {
          "date" : 1,
          "day" : 3,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1485910861000,
          "timezoneOffset" : 0,
          "year" : 117
        },
        "topic" : "Graphics 2"
      } ],
      "name" : "Graphics"
    }, {
      "lectures" : [ {
        "endTime" : {
          "date" : 1,
          "day" : 4,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1517446861000,
          "timezoneOffset" : 0,
          "year" : 118
        },
        "room" : {
          "name" : "J100"
        },
        "starTime" : {
          "date" : 1,
          "day" : 3,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1485910861000,
          "timezoneOffset" : 0,
          "year" : 117
        },
        "topic" : "Artificial 1"
      }, {
        "endTime" : {
          "date" : 1,
          "day" : 4,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1517446861000,
          "timezoneOffset" : 0,
          "year" : 118
        },
        "room" : {
          "name" : "J200"
        },
        "starTime" : {
          "date" : 1,
          "day" : 3,
          "hours" : 1,
          "minutes" : 1,
          "month" : 1,
          "seconds" : 1,
          "time" : 1485910861000,
          "timezoneOffset" : 0,
          "year" : 117
        },
        "topic" : "Artificial 2"
      } ],
      "name" : "Artificial intelligence"
    } ],
    "name" : "Computer Science",
    "students" : [ {
      "name" : "Leonardo Dicaprio"
    }, {
      "name" : "John Lennon"
    }, {
      "name" : "Anthony Bond"
    }, {
      "name" : "Andy Jones"
    } ]
  }
  </code></pre>
  
  <p>}</p>