title: Filter Realtime Database Android
body: <p>I want to create an application that any user can add an advert (announce) with something that he wants to sell.
  This is the structure of the Real-time Database in Firebase:</p>
  
  <pre><code>- advert
      - category
          - {uid}
              - title
              - price
              - description
              - location
  </code></pre>
  
  <p>I want to let the user to filter the adverts by category, title, and price.</p>
  
  <p>Currently, I can filter the adverts only by title like this:</p>
  
  <pre><code>FirebaseDatabase.getInstance().getReference()
                      .child("adverts")
                      .orderByChild("title")
                      .startAt("tv")
                      .limitToFirst(20)
  </code></pre>
  
  <p>I have 3 questions:</p>
  
  <ol>
  <li>How can i add more "and clauses"? Or how should i structure the nodes to filter more values?</li>
  <li>How should I sort the values that i receive from the server in ascending order or descending order depending on uid?</li>
  <li>Seems that the method startAt("abc") is not fetching only the children that has contains in the title "tv". Am i doing something wrong? How should I fetch only the children that contains the string "tv"?</li>
  </ol>