title: $max aggregation not showing my desired output
body: <p>This is the updated version of <code>$max</code>. I have tried out this code of your.</p>
  
  <pre><code>db.contact.aggregate([
     {$sort: {machine_Id: 1, date:1}},
     {$group:{
        _id: '$machine_Id',
        max_air_Temp: {$max:"$air_Temp"}
       }
     }
    ], function(err, meibanlist) {
        if (err || !meibanlist ) console.log("Record not found");
        else meibanlist.forEach (function(machine_Id){
            console.log(machine_Id);
        })
  });
  </code></pre>
  
  <p>but when i ran that in mongodb, it gave me:</p>
  
  <pre><code>{ _id: 5, max_air_Temp: 819 }
  { _id: 857, max_air_Temp: 121 }
  { _id: 52, max_air_Temp: 146 }
  { _id: 67, max_air_Temp: 300 }
  { _id: 655, max_air_Temp: 84 }
  { _id: 15, max_air_Temp: 844 }
  { _id: 363, max_air_Temp: 861 }
  { _id: 717, max_air_Temp: 623 }
  { _id: 189, max_air_Temp: 639 }
  { _id: 346, max_air_Temp: 563 }
  { _id: 470, max_air_Temp: 804 }
  { _id: 917, max_air_Temp: 697 }
  { _id: 167, max_air_Temp: 438 }
  { _id: 4, max_air_Temp: 467 }
  </code></pre>
  
  <p>But when i tried this code:</p>
  
  <pre><code>db.contact.aggregate([{$group: {_id: "machine_Id", max: {$max: "$air_Temp"}}}], 
    function(err, meibanlist) {
      if (err || !meibanlist) console.log("Record not found");
      else meibanlist.forEach (function(machine_Id){
        console.log(machine_Id);
      })
    });
  </code></pre>
  
  <p>it showed me this output: This output is more similar to what i want because it shows me only one output but i would want the <code>'machine_id'</code> to show the exact id rather than the word <code>machine_id</code>. Do you know how to edit this set?</p>
  
  <p>output: </p>
  
  <pre><code>{ _id: 'machine_Id', max: 997 }
  </code></pre>