title: Firebase path referring
body: <p>I am working on an android app and on my firebase database I have structure that look like this:</p>
  
  <pre><code>{
    "messages" : {
      "-Kn_ZygVCYa3NopeFqTM" : {
        "byUser" : "MzE7ySZywtZ20dK6UzayQ7juuUu2",
        "message" : "HeHeHaHa",
        "time_added" : 1498500294106,
        "used_count" : 0,
        "verified" : true
      },
      "message_2" : {
        "by_user" : "amdin",
        "message" : "Happy Diwali",
        "time_added" : 978451321,
        "used_count" : 5,
        "verified" : false
      },
      "message_3" : {
        "by_user" : "admin",
        "message" : "My best wished even if they are belated.",
        "time_added" : 456897986,
        "used_count" : 8,
        "verified" : false
      }
    }
  }
  </code></pre>
  
  <p>I have <code>".read" = true;</code> permission on messages node. What I need is to filter the messages and get only those nodes which have verified flag as true. i.e. the above should return only <code>-Kn_ZygVCYa3NopeFqTM</code> message.</p>
  
  <p>My code to get it for now is:</p>
  
  <pre><code>mMessagesDatabaseReference = mFirebaseDatabase.getReference().child("messages");
  mMessagesReference.equalTo("verified", "true")
                  .addListenerForSingleValueEvent(new ValueEventListener() {
              @Override
              public void onDataChange(DataSnapshot dataSnapshot) {
                  Log.e(TAG, dataSnapshot.toString());
              }
  
              @Override
              public void onCancelled(DatabaseError databaseError) {
                  Log.e(TAG, databaseError.toString());
              }
          });
  </code></pre>
  
  <p>snapshot comes out to be null with this. The reason for this may be that messages has no child called verified, but whole problem is, that I don't have id's of messages beforehand. What should be the workaround to this?</p>