title: Mongo: Group, push and sort
body: <p>I have a mongodb collection data as per below;I want to group by  EmployeedID( i.e 0001) and then sort(by age) </p>
  
  <pre><code>{
  "_id" : ObjectId("54d0512191a4da7736e9db43"),
  "EmployeeID" : "0001",
  "Speciality" : "xxx",
  "Code" : "P",
  "Age" : 8
  }
  
  /* 1 */
  {
  "_id" : ObjectId("54d0512191a4da7736e9db44"),
  "EmployeeID" : "0002",
  "Speciality" : "yyyyy",
  "Code" : "P",
  "Age" : 6
   }
  
  /* 2 */
  {
  "_id" : ObjectId("54d0512191a4da7736e9db45"),
  "EmployeeID" : "0001",
  "Speciality" : "zzz",
   "Code" : "P",
   "Age" : 5
   }
  </code></pre>
  
  <p>I know I can group using the following way.</p>
  
  <pre><code>collection.aggregate([
  {$match:{"EmployeeId":0001}},
  {$group:{"_id":"$EmployeeID",
          "speciality":{$push:"$Speciality"},
          "Code":{$push:"$Code"},
          "Age":{$push:"$Age"}}}
   ])
  </code></pre>
  
  <p>But how can I using $sort here? SO my result can be something like below;</p>
  
  <pre><code>[{ "EmployeeID" : "0001",
  "speciality" : [ "zzz","xxx"],
   "Code" :[ "P","P"],
   "Age" : [5,8]
   }]
  </code></pre>