title: Getting list of all posts with user like and total likes for each post in firestore
body: <p>This question is related to querying firestore and best approach for implementing like system and counting no of likes for each post in <strong>firestore</strong>.</p>
  
  <p>Let us say we have collection called posts, likes, comments, hashtags. Which has json structure like this.</p>
  
  <pre><code>posts:[{                   likes [{                      
    postId:id                postId:,                       
    createdAt:date           userId,                       
    title:string,            collectionType:'posts', 
    description,string       likedAt:date
    updatedAt,date          }]    
    createdUser:userId
    updatedUser:userId,    
  }]
  
  comments:[{              hashtags [{}]
    postId,
    userComments:[{
      userId:,
      comment:'',
      commentedAt:''      
      replies:[{}]
   }]
  </code></pre>
  
  <ol>
  <li><p>What is best approach to implement like system with user comments
  along with nested replies for each comment in which improves
  efficiency and performance when we have millions of users and posts.</p></li>
  <li><p>Querying all posts with likes count on it and like whether logged in user 
  like each post along with comments and comments count, fetching replies per 
  comment if available.</p></li>
  <li><p>Is that my approach will work for firestore ? Or any best data modelling 
  design also possible.</p></li>
  <li><p>Do we need to store hashtags in separate collection of in same collection 
  i.e while create post, inside post object with hashtags array.</p></li>
  </ol>
  
  <p>I'm newbie to firestore, I want to learn querying data in firestore. 
  On basis of my knowledge in mongodb,  I want to explore in firestore. Please help me in my problem case. Any suggestions or guidance is highly appreciated.</p>
  
  <p>Thanks </p>