title: MongoDB Count and groupby subdocument
body: <p>I have the following document:</p>
  
  <pre><code>{
      "id":1,
      "url":"mysite.com",
      "views": 
       [
         {"ip":"1.1.1.1","date":"01-01-2015"},
         {"ip":"2.2.2.2","date":"01-01-2015"},
         {"ip":"1.1.1.1","date":"01-01-2015"},
         {"ip":"1.1.1.1","date":"01-01-2015"}
       ]
  }
  </code></pre>
  
  <p>If i want to count how many unique ips (groupBy), how can I do that with mongo?</p>