title: mongodb aggregation framework group + project
body: <p>I have the following issue:</p>
  
  <p>this query return 1 result which is what I want:</p>
  
  <pre><code>&gt; db.items.aggregate([ {$group: { "_id": "$id", version: { $max: "$version" } } }])
  
  {
  "result" : [
      {
          "_id" : "b91e51e9-6317-4030-a9a6-e7f71d0f2161",
          "version" : 1.2000000000000002
      }
  ],
  "ok" : 1
  }
  </code></pre>
  
  <p>this query ( I just added projection so I can later query for the entire document) return multiple results. What am I doing wrong?</p>
  
  <pre><code>&gt; db.items.aggregate([ {$group: { "_id": "$id", version: { $max: "$version" } }, $project: { _id : 1 } }])
  
    {
  "result" : [
      {
          "_id" : ObjectId("5139310a3899d457ee000003")
      },
      {
          "_id" : ObjectId("513931053899d457ee000002")
      },
      {
          "_id" : ObjectId("513930fd3899d457ee000001")
      }
  ],
  "ok" : 1
  }
  </code></pre>