title: mongodb find matches based on count aggregation
body: <p>I have a mongodb collection like this:</p>
  
  <pre><code>{"uid": "01370mask4",
   "title": "hidden",
   "post: "hidden",
   "postTime": "01-23, 2016",
   "unixPostTime": "1453538601",
   "upvote": [2, 3]}
  </code></pre>
  
  <p>and I'd like to select post records from the users with more than 5 posts. The stucture should be the same, I just don't need the documents from users who don't have many posts.</p>
  
  <pre><code>db.collection.aggregate(
     [
       { $group : { _id : "$uid", count: { $sum: 1 } } }
     ]
  )
  </code></pre>
  
  <p>Now I'm stuck at how to use the count values to find. I searched but didn't find any methods to add the count values back to the same collection by uid. Saving the aggregation output and joining them together seems not supported by mongodb. Please advise, thanks!</p>
  
  <p>Update:</p>
  
  <p>Sorry that I didn't make it clear earlier. Thanks for your prompt answers! I want a subset of the original collection, with post text, post timestamp, etc. I don't want a subset of the aggregation output.</p>