title: Mongodb aggregation by day based on unix timestamp
body: <p>I have googled alot, but not found any helpful solution... I want to find total number of daily users. 
  I have a collection named <strong>session_log</strong> having documents like following</p>
  
  <pre><code>{
      "_id" : ObjectId("52c690955d3cdd831504ce30"),
      "SORTID" : NumberLong(1388744853),
      "PLAYERID" : 3,
      "LASTLOGIN" : NumberLong(1388744461),
      "ISLOGIN" : 1,
      "LOGOUT" : NumberLong(1388744853)
  }
  </code></pre>
  
  <p>I want to aggregate from LASTLOGIN... </p>
  
  <p>This is my query:</p>
  
  <pre><code>db.session_log.aggregate(
      { $group : {
          _id: {
              LASTLOGIN : "$LASTLOGIN"
          },
          count: { $sum: 1 }
      }}
  );
  </code></pre>
  
  <p>But it is aggregating by each login time, not by each day. Any help would be appreciated</p>