title: Firestore: Creating a comment system for arbitrary content
body: <p>My goal is to create a reddit-like comment system where:</p>
  
  <ul>
  <li>An author creates a <code>post</code></li>
  <li>A user can add <code>comment</code> under the post. </li>
  <li>A user can add a <code>reply</code> to a comment (a comment under a comment?)</li>
  </ul>
  
  <p>I wonder how this could be accomplished with Firestore. My approach is the following:</p>
  
  <ol>
  <li>Create a <code>post__comments</code> collection which contains documents with the ID of the post.</li>
  <li>Under each document (which represents a <code>post</code>, I can house comments which are ordered by created date.</li>
  </ol>
  
  <p>However, how can we efficiently implement a <code>reply</code> to a <code>comment</code>? I suppose that we can create a <code>comment__reply</code> collection; this approach seems like it will require a lot of querying. Imagine if we have more than 10 <code>posts</code> and more than 10 <code>comments</code> and <code>replies</code> per post. This seems like a costly approach.</p>
  
  <p>Many thanks for any advice you can give to me. </p>