{"action":"created","issue":{"url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1021","repository_url":"https://api.github.com/repos/MongoEngine/mongoengine","labels_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1021/labels{/name}","comments_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1021/comments","events_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1021/events","html_url":"https://github.com/MongoEngine/mongoengine/pull/1021","id":85944568,"number":1021,"title":"aggregate_sum/average + unit tests","user":{"login":"wojcikstefan","id":1718372,"avatar_url":"https://avatars.githubusercontent.com/u/1718372?v=3","gravatar_id":"","url":"https://api.github.com/users/wojcikstefan","html_url":"https://github.com/wojcikstefan","followers_url":"https://api.github.com/users/wojcikstefan/followers","following_url":"https://api.github.com/users/wojcikstefan/following{/other_user}","gists_url":"https://api.github.com/users/wojcikstefan/gists{/gist_id}","starred_url":"https://api.github.com/users/wojcikstefan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wojcikstefan/subscriptions","organizations_url":"https://api.github.com/users/wojcikstefan/orgs","repos_url":"https://api.github.com/users/wojcikstefan/repos","events_url":"https://api.github.com/users/wojcikstefan/events{/privacy}","received_events_url":"https://api.github.com/users/wojcikstefan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/MongoEngine/mongoengine/labels/Aggregation%20Framework","name":"Aggregation Framework","color":"fef2c0"},{"url":"https://api.github.com/repos/MongoEngine/mongoengine/labels/Enhancement","name":"Enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/MongoEngine/mongoengine/milestones/17","html_url":"https://github.com/MongoEngine/mongoengine/milestones/0.10","labels_url":"https://api.github.com/repos/MongoEngine/mongoengine/milestones/17/labels","id":1098863,"number":17,"title":"0.10","description":"","creator":{"login":"MRigal","id":2190327,"avatar_url":"https://avatars.githubusercontent.com/u/2190327?v=3","gravatar_id":"","url":"https://api.github.com/users/MRigal","html_url":"https://github.com/MRigal","followers_url":"https://api.github.com/users/MRigal/followers","following_url":"https://api.github.com/users/MRigal/following{/other_user}","gists_url":"https://api.github.com/users/MRigal/gists{/gist_id}","starred_url":"https://api.github.com/users/MRigal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MRigal/subscriptions","organizations_url":"https://api.github.com/users/MRigal/orgs","repos_url":"https://api.github.com/users/MRigal/repos","events_url":"https://api.github.com/users/MRigal/events{/privacy}","received_events_url":"https://api.github.com/users/MRigal/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":37,"state":"closed","created_at":"2015-05-06T16:17:07Z","updated_at":"2015-06-26T08:50:24Z","due_on":"2015-06-20T22:00:00Z","closed_at":"2015-06-24T08:21:08Z"},"comments":19,"created_at":"2015-06-07T21:18:24Z","updated_at":"2016-06-10T08:45:10Z","closed_at":"2015-06-18T21:14:27Z","pull_request":{"url":"https://api.github.com/repos/MongoEngine/mongoengine/pulls/1021","html_url":"https://github.com/MongoEngine/mongoengine/pull/1021","diff_url":"https://github.com/MongoEngine/mongoengine/pull/1021.diff","patch_url":"https://github.com/MongoEngine/mongoengine/pull/1021.patch"},"body":"Closes #569 \r\n\r\n@MRigal here's the implementation of sum & average using the aggregation framework. I haven't tested it in a sharded environment, but if it works, I believe it could fully replace the slower, map-reduce-based `BaseQuerySet.sum` and `BaseQuerySet.average`.\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/mongoengine/mongoengine/1021)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/comments/225126081","html_url":"https://github.com/MongoEngine/mongoengine/pull/1021#issuecomment-225126081","issue_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1021","id":225126081,"user":{"login":"wojcikstefan","id":1718372,"avatar_url":"https://avatars.githubusercontent.com/u/1718372?v=3","gravatar_id":"","url":"https://api.github.com/users/wojcikstefan","html_url":"https://github.com/wojcikstefan","followers_url":"https://api.github.com/users/wojcikstefan/followers","following_url":"https://api.github.com/users/wojcikstefan/following{/other_user}","gists_url":"https://api.github.com/users/wojcikstefan/gists{/gist_id}","starred_url":"https://api.github.com/users/wojcikstefan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wojcikstefan/subscriptions","organizations_url":"https://api.github.com/users/wojcikstefan/orgs","repos_url":"https://api.github.com/users/wojcikstefan/repos","events_url":"https://api.github.com/users/wojcikstefan/events{/privacy}","received_events_url":"https://api.github.com/users/wojcikstefan/received_events","type":"User","site_admin":false},"created_at":"2016-06-10T08:45:09Z","updated_at":"2016-06-10T08:45:09Z","body":"I think it would make sense to replace the original methods with the new ones. I believe it's supported by all versions of MongoDB >= 2.2 when the aggregation framework was introduced. Also, the less raw JS code in MongoEngine, the better IMHO :)\r\n\r\nCurious what @thedrow thinks about this!"}}
{"actor":{"display_login":"wojcikstefan"}}