title: how to convert timestamp to ISO date in mongodb aggregate
body: <p>I am using node.js mongodb client.
  I have a timestamp value in a collection, now I want to use aggregate to convert timestamp to IOSDate, so I can compare it easily. But I do not know how to do it.</p>
  
  <pre><code>   var db = game.getDB();
      var coll = db.collection("LoginRecord");
      coll.aggregate([
          {
              $project: {
                  "PT" : 1,
                  "PID" : 1,
                  "regDate" : new Date("$createTime"), //#####createTime is a timestamp, I want to convert it to IOSDate
                  "loginDay" : { $dayOfYear : "$_serverDate"}
              }
          },
          {
              $group : {
                  "_id" : "$loginDay",
                  "logUsers" : { $addToSet: "$PID"}
              }
          },
          {
              $unwind : "$logUsers"
          },
          {
              "$group" : {
                  "_id" : "$_id",
                  "logCount" : { $sum: 1}
              }
          }
      ], function(err, res) {
          logger.info("aggregate res " + JSON.stringify(res));
      });
  </code></pre>