title: Firestore - How to handle queries inside an object of document?
body: <p>I have <code>users</code> collection. A single document of <code>users</code> is built like this:</p>
  
  <pre><code>interface User {
    coaching?: {
      sampleOfCoach: Coaching
      anotherSample: Coaching
    }
    displayName: string;
    email: string;
    isCoach: boolean;
    photoURL: string;
    uid: string;
  }
  </code></pre>
  
  <p>I want to get only the docs from the <code>users</code> collection that has:</p>
  
  <ul>
  <li><code>isCoach: true</code></li>
  <li><code>coaching.{nameOfCoach}</code></li>
  </ul>
  
  <p>Which leads me to another two question.</p>
  
  <p>First, in firebase docs, they recommend to keep the same structures for all of the docs in the same collection. Which means, I should keep the <code>coaching</code> property in a non-coach user doc.</p>
  
  <p>Second, On one hand, the <code>isCoach</code> property is redundent because I can check if the user is a coach or not depending on the <code>coaching</code> property. On the other hand, what if I want to query all of the coaches? is there a query that can check the size of an object?</p>
  
  <hr>
  
  <p>I know there are multiple questions in here, but each question has to do with another question, so I decided to write them in a single question.</p>