title: FireStore Query sub collection
body: <p>i have the following structure in FireStore,</p>
  
  <ul>
  <li><p>questions [collection]</p>
  
  <ul>
  <li><p>quiz 1 [document]</p>
  
  <ul>
  <li>results[collection]</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>I want to have questions in the questions collection, then, when a user answers a question, his/her result is stored in the question's sub collection with user's string id as the id. My problem is, how can i query to get questions a user has not answered. i.e unanswered questions are those that don't have a result with user's id as their id. Hope am clear enough on this. Thanks.<a href="https://i.stack.imgur.com/M7Hxm.png" rel="nofollow noreferrer">FireStore Screenshot</a></p>
  
  <pre><code>val questionsRef = db.collection("questions")
  val query = questionsRef.whereEqualTo(
          questionsRef.document().collection( "results" ).document(App.INSTANCE.appUUIDString), null)
          .limit(50).get()
  </code></pre>