title: Mongoose find all posts and get the hottest categories
body: <p>i have this problem where i need to find the hottest categories from all the posts that i've search.</p>
  
  <p>This is my POST schema model</p>
  
  <pre><code>var PostSchema = new mongoose.Schema({
      maincategory: String,
      subcategory: String,
      quantity: String,
      budget: Number,
      name: String,
      description: String,
  });
  
  
  PostSchema.index({name: 'text', description: 'text'});
  </code></pre>
  
  <p>So what i need to do is, crawl to all the posts, check their main category and sub category, then after crawling to all posts and get their categories, i need to count on how many posts on this categories then sort out the categories where i will show the categories which has the highest amount of posts. Then i will show which categories are the hottest, maybe top 5</p>
  
  <p>Thank you!</p>