title: Mongo DB aggregation array size greater than match
body: <p>I have a collection where investments is an array inside the mongodb document. Now using aggregation I am trying to filter results where investments length is more than 5 times and then do the next processing using match query.</p>
  
  <pre><code> Collection{
   _id:000000
   --------------------- 
   "investments" : [      {
            hhhhhhhhhhhhhh 
           },
           {
             hhhhhhhhhhhhhh 
            } }]
  -----------------
  </code></pre>
  
  <p>The match query I wrote like below which isn't working. Any suggestions:</p>
  
  <pre><code>db.companies.aggregate( [
      { $match:  {"founded_year" : 2004}, 
    {  "investments" : {$size: : { $gte: 5 } } }  },
  ----------------------------------
  --------------------------------
  ]}
  </code></pre>