title: Use of $avg function within MongoDB aggregation framework does not appear to alter returned value
body: <p>I'm sure there's something relatively obvious that I'm missing. Basically, these two queries return the exact same result despite the use of the $avg and $sum:1 functions, from what I understand the first query should return an average of the previously grouped row count? </p>
  
  <pre><code>db.bbservicedata.aggregate( 
  { 
     $match:{"accesstime" : {"$gte" : ISODate('2012-02-09T01:45:32.962Z') }}
  },  
  
  {
     $match:{"requestModel.serviceName" : "ContentItem"}},    
  {
  
     $unwind: "$requestModel.methodParams.ContentItemLoggingListModel.items"},
  
  { 
  
  $group: {
   _id:{
     myYear:{$year:"$accesstime"},
     myMonth:{$month:"$accesstime"},
     myDay:{$dayOfMonth:"$accesstime"}}, 
     count:{$sum:1}}}, 
  { 
  $group: {
   _id: {
     year: "$_id.myYear",
     month: "$_id.myMonth",
     day: "$_id.myDay"}, 
     averagecount : {$avg : "$count"}}},  
  
     //{averagecount : {$sum: "$count"}}}***, -- Returns the same result*
  
   {$sort: {averagecount:-1}} 
  );
  </code></pre>
  
  <p>Any assistance would be very much appreciated, thanks in advance! </p>