title: $dateToString returns null with $group in mongodb
body: <p>I am trying to do group by using an id field,datetime field and project the sum of values and date field. </p>
  
  <pre><code>db.getCollection('driver_collections').aggregate([
  {$group : { _id: {driverid:"$driver_id",day:{ $dayOfMonth: "$time_in"},
                    month:{$month:"$time_in"},year:{$year:"$time_in"}},
      amountCollected : {$sum:"$total_collection"}}    
      },{
         $project: {
            yearMonthDay: { $dateToString: { format: "%Y-%m-%d", date: "$time_in" }},
            amountCollected : 1
         }
     }]) 
  </code></pre>
  
  <p>I used above query and got the result as </p>
  
  <pre><code>{
      "_id" : {
          "driverid" : "58014ce1f39e0f9dc40000b2",
          "day" : 30,
          "month" : 10,
          "year" : 2016
      },
      "amountCollected" : 2094.0,
      "yearMonthDay" : null
  }
  </code></pre>
  
  <p>I need to get yearMonthDay as</p>
  
  <blockquote>
    <p>"yerMonthDay" : "2016-10-30"</p>
  </blockquote>
  
  <p>When I use <strong>$dateToString</strong> without $group it works fine. What did I miss here. </p>