title: Select Group by count and distinct count in same mongodb query
body: <p>I am trying to do something like</p>
  
  <pre><code>select campaign_id,campaign_name,count(subscriber_id),count(distinct subscriber_id)
  group by campaign_id,campaign_name from campaigns;
  </code></pre>
  
  <p>This query giving results except count(distinct subscriber_id)</p>
  
  <pre><code>db.campaigns.aggregate([
      {$match: {subscriber_id: {$ne: null}}},
      {$group: { 
          _id: {campaign_id: "$campaign_id",campaign_name: "$campaign_name"},
          count: {$sum: 1}
      }}
  ])
  </code></pre>
  
  <p>This following query giving results except count(subscriber_id)</p>
  
  <pre><code>db.campaigns_logs.aggregate([
      {$match : {subscriber_id: {$ne: null}}},
      {$group : { _id: {campaign_id: "$campaign_id",campaign_name: "$campaign_name",subscriber_id: "$subscriber_id"}}},
      {$group : { _id: {campaign_id: "$campaign_id",campaign_name: "$campaign_name"}, 
                  count: {$sum: 1}
                }}
  ])
  </code></pre>
  
  <p>but I want count(subscriber_id),count(distinct subscriber_id) in the same result</p>