title: Count the number of times object an property exists in mongo array of objects
body: <p>I have a document structure like this </p>
  
  <pre><code>[{
   name: "Something",
   codes: [
           {type: 11}, 
           {type: 11}, 
           {type: 15}
          ]
   },
   {
   name: "Another",
   codes: [
           {type: 11}, 
           {type: 12}, 
           {type: 15},
           {type: 11}
          ]
   }]]
  </code></pre>
  
  <p>I need to count how many times <code>type = 11</code> appears per entry, in the collection. 
  I have am stumped. </p>