title: Firebase realtime database - how to get parent name based on a value of one of its keys
body: <p>The structure looks like this:</p>
  
  <pre><code>users
      |----username1
           |----uid:value
           username2
           |----uid:value
  </code></pre>
  
  <p>I'm trying to find the best way to get the username value based of the value of it's uid,<br/>
  This need to be in Java code (Android), So far I found the following code:</p>
  
  <pre><code>Query uid = reference.child("users").orderByChild("uid").equalTo(uid);
  uid.addListenerForSingleValueEvent(new ValueEventListener() {
    @Override
    public void onDataChange(DataSnapshot dataSnapshot) {
      for(DataSnapshot datas: dataSnapshot.getChildren()){
        String keys=datas.getKey();
        if (keys.equals(uid)) {
          // uid found
        } else {
  
        }
      }
    }
    @Override
    public void onCancelled(DatabaseError databaseError) {
  
    }
  });
  </code></pre>