title: MongoDB: Create Object in Aggregation result
body: <p>I want to return Object as a field in my Aggregation result similar to the solution in <a href="https://stackoverflow.com/questions/24674163/create-object-in-aggregation">this</a> question. However in the solution mentioned above, the Aggregation results in an Array of Objects with just one item in that array, not a standalone Object. For example, a query like the following with a <code>$push</code> operation</p>
  
  <pre><code> $group:{
       _id: "$publisherId",
       'values' : { $push:{
           newCount: { $sum: "$newField" },
           oldCount: { $sum: "$oldField" } }
       }
  }
  </code></pre>
  
  <p>returns a result like this </p>
  
  <pre><code>{
          "_id" : 2,
          "values" : [ 
              {
                  "newCount" : 100, 
                  "oldCount" : 200
              }
          ]
      }
  }
  </code></pre>
  
  <p>not one like this</p>
  
  <pre><code>{
          "_id" : 2,
          "values" : {
                  "newCount" : 100, 
                  "oldCount" : 200
           }
      }
  }
  </code></pre>
  
  <p>The latter is the result that I require. So how do I rewrite the query to get a result like that? Is it possible or is the former result the best I can get?</p>