春雨活动 2017-04-11 参加活动的人数 pipeline

[
  {
    $match: {
      code: 'spring_rain',
      'origin.date': '2017-04-11',
      active: true,
      used: true
    }
  },
  {
    $project: {
      user_id: {
        $ifNull: [
          "$origin.user_id",
          "$user_id"
        ]
      }
    }
  },
  {
    $group: {
      _id: '$user_id',
      count: {
        $sum: 1
      }
    }
  },
  {
    $group:{
      _id: 'count',
      count: {
        $sum: 1
      }
    }
  }
]