{"action":"opened","issue":{"url":"https://api.github.com/repos/mongojack/mongojack/issues/116","labels_url":"https://api.github.com/repos/mongojack/mongojack/issues/116/labels{/name}","comments_url":"https://api.github.com/repos/mongojack/mongojack/issues/116/comments","events_url":"https://api.github.com/repos/mongojack/mongojack/issues/116/events","html_url":"https://github.com/mongojack/mongojack/issues/116","id":106567115,"number":116,"title":"Group on multiple fields","user":{"login":"balone1988","id":1162475,"avatar_url":"https://avatars.githubusercontent.com/u/1162475?v=3","gravatar_id":"","url":"https://api.github.com/users/balone1988","html_url":"https://github.com/balone1988","followers_url":"https://api.github.com/users/balone1988/followers","following_url":"https://api.github.com/users/balone1988/following{/other_user}","gists_url":"https://api.github.com/users/balone1988/gists{/gist_id}","starred_url":"https://api.github.com/users/balone1988/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balone1988/subscriptions","organizations_url":"https://api.github.com/users/balone1988/orgs","repos_url":"https://api.github.com/users/balone1988/repos","events_url":"https://api.github.com/users/balone1988/events{/privacy}","received_events_url":"https://api.github.com/users/balone1988/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-15T14:23:19Z","updated_at":"2015-09-15T14:23:19Z","closed_at":null,"body":"Looking through the source code and documentation, it does not appear to be possible to group on multiple fields in the same stage using the Aggregations API. The first example from the MongoDB documentation shows this being done natively:\r\n\r\n```\r\ndb.sales.aggregate(\r\n   [\r\n      {\r\n        $group : {\r\n           _id : { month: { $month: \"$date\" }, day: { $dayOfMonth: \"$date\" }, year: { $year: \"$date\" } },\r\n           totalPrice: { $sum: { $multiply: [ \"$price\", \"$quantity\" ] } },\r\n           averageQuantity: { $avg: \"$quantity\" },\r\n           count: { $sum: 1 }\r\n        }\r\n      }\r\n   ]\r\n)\r\n```\r\n\r\nHave I missed something by any chance?"}}