title: Get a Firebase Database Reference depending on a specific parameter - Android Studio
body: <p>I usually get the reference of my tupla from firebase database like this: </p>
  
  <pre><code>private DatabaseReference needsRef;
  
  public void onCreate(...) {
       ...
       needsRef = FirebaseDatabase.getInstance().getReference().child("favors");
  }
  </code></pre>
  
  <p>But now I would like to put inside "needsRef" just the rows which content a specify parameter call "type". If (type == "need"), put these rows in "needsRef" and if (type == "offer"), put it in another DatabaseReference called "offersRef".</p>
  
  <p><img src="https://i.stack.imgur.com/JMRlH.png" alt="I show a screenshot of my database to clarify the question"></p>
  
  <p>The child after "favors" on the database is a name which is not always the same. 
  <img src="https://i.stack.imgur.com/PSGxo.png" alt="I show the image"></p>
  
  <p>Could u help me please?</p>