title: How to use $dateToString in $group pipeline Mongodb Aggregation?
body: <p>I am using Mongodb 3.0 and i want to use <code>$dateToString</code> in specific format for example <code>Thu 10-Nov-2016</code>. Here is my code</p>
  
  <pre><code>collection.aggregate([
      { 
          $group: {
              _id: { 
                  month: { $month: "$onDate" }, 
                  day: { $dayOfMonth: "$onDate" }, 
                  year: { $year: "$onDate" } 
              },
              totalSearch: { $sum: 1 }
          }
      },
      { $limit: 10 },
      { $sort: { '_id.year': -1,'_id.month': -1,'_id.day': -1 } },
      //***Here i am want to use $dateToString with $project corresponding to $group._id****////
      { $project: { $dateToString: { format: 'xxxxxxxx', date: xxxxxxxxx } } } 
  ],
      function(err, dayWise) {
          if (err)
              cb(err);
          console.log('dayWises',dayWise);
              cb(null, dayWise);
      }
  )
  </code></pre>