title: Firestore: filter for user generated content
body: <p>My data structure looks like:</p>
  
  <pre><code>collection
  -- id_1 (document)
  ---- rating : 0
  ---- date : 1506266576364
  ---- tags : { car : true, boat : true }
  -- id_2 (document)
  ---- rating : 1
  ---- date : 1506266540000
  ---- tags : { car : true, plane : true }
  </code></pre>
  
  <p>And my query looks like:</p>
  
  <pre><code>ref
  .where('tags.car', '==', true)
  .orderBy('rating', 'desc')
  .limit(5)
  </code></pre>
  
  <p>In words: I want to retrieve all documents that have the given tag assigned, ordered by rating, limited to 5. So this is the top 5 rated using this tag.</p>
  
  <p>Firestore tells me that this is no problem if I create a composite index for this query and tells me how to create it.
  This is not possible for me because the tags are user generated, and as far as I understood, I cannot create composite indices programmatically.</p>
  
  <p>I am not sure if it makes a difference when using a subcollection instead of an object.</p>
  
  <p>What is a possible way to query for user generated content?</p>