title: Retrieving child value without knowing key value from Firebase realtime database
body: <p>I want to get the parent key value where the the "drinkManufacturerID" is equal to the currentUsers <code>UID</code>. However, I will not know the value of the <code>VenueID</code> or the <code>PushID</code> (see below). How can I check if the value for "drinkManufacturerID" is equal, without knowing these values. Is it possible without restructuring my database?</p>
  
  <p>Relevant Code:</p>
  
  <pre><code>public class DealRawDataActivity extends AppCompatActivity {
  
  
  DatabaseReference databaseDrinks;
  DatabaseReference databaseManufacturer;
  
  
  String keys;
  
  FirebaseUser currentFirebaseUser = FirebaseAuth.getInstance().getCurrentUser();
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_deal_raw_data);
  
  
      databaseDrinks = FirebaseDatabase.getInstance().getReference("drinks").child("-LWLuM2nesg0uaP0dLSn"); //However, this string will not be know! How to get this string value?
  
      //To later be used in listView
      databaseDrinks.orderByChild("drinkManufacturerID").equalTo(currentFirebaseUser.getUid()).addValueEventListener(new ValueEventListener() {
          @Override
          public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
              for (DataSnapshot datas : dataSnapshot.getChildren()) {
                  keys = datas.getKey();
              }
              Toast.makeText(getApplicationContext(), keys, Toast.LENGTH_LONG).show();
          }
          @Override
          public void onCancelled(@NonNull DatabaseError databaseError) {
  
          }
      });
  
     //databaseManufacturer = FirebaseDatabase.getInstance().getReference("drinks").child(keys);
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Database Structure:</p>
  
  <p><a href="https://i.stack.imgur.com/EGC8C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EGC8C.png" alt="enter image description here"></a></p>