{"action":"created","issue":{"url":"https://api.github.com/repos/pyeve/eve/issues/1134","repository_url":"https://api.github.com/repos/pyeve/eve","labels_url":"https://api.github.com/repos/pyeve/eve/issues/1134/labels{/name}","comments_url":"https://api.github.com/repos/pyeve/eve/issues/1134/comments","events_url":"https://api.github.com/repos/pyeve/eve/issues/1134/events","html_url":"https://github.com/pyeve/eve/issues/1134","id":314261605,"number":1134,"title":"aggregate query replacement does not handle arrays","user":{"login":"sphet","id":2746792,"avatar_url":"https://avatars2.githubusercontent.com/u/2746792?v=4","gravatar_id":"","url":"https://api.github.com/users/sphet","html_url":"https://github.com/sphet","followers_url":"https://api.github.com/users/sphet/followers","following_url":"https://api.github.com/users/sphet/following{/other_user}","gists_url":"https://api.github.com/users/sphet/gists{/gist_id}","starred_url":"https://api.github.com/users/sphet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sphet/subscriptions","organizations_url":"https://api.github.com/users/sphet/orgs","repos_url":"https://api.github.com/users/sphet/repos","events_url":"https://api.github.com/users/sphet/events{/privacy}","received_events_url":"https://api.github.com/users/sphet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-13T21:54:56Z","updated_at":"2018-05-01T08:30:55Z","closed_at":null,"author_association":"NONE","body":"Consider the following query:\r\n\r\nhttp://testserver.com/api/averages/?aggregate{ $name\":\"teapot\"}\r\n\r\nAnd the following aggregate on the endpoint:\r\n\r\n```\r\npipeline=[\r\n  // ... more\r\n  {\r\n    '$group' : {    '_id' : { \r\n       // ... more fields\r\n       debug_name' : '$name' }, \r\n       'avg' : { '$avg' : { '$arrayElemAt': ['$name',0] }  },\r\n       'min' : { '$min' : { '$arrayElemAt': ['$name',1] }  },\r\n       'max' : { '$max' : { '$arrayElemAt': ['$name',2] }  },\r\n     }\r\n}\r\n]\r\n```\r\n\r\ndebug_name will be correctly replaced, but $name in the avg, min and max will not.\r\n\r\nThe parsing code in get.py only considers nesting via dicts, not arrays.\r\n\r\nIt would be great to fix this as I have no other solution\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/pyeve/eve/issues/comments/385624778","html_url":"https://github.com/pyeve/eve/issues/1134#issuecomment-385624778","issue_url":"https://api.github.com/repos/pyeve/eve/issues/1134","id":385624778,"user":{"login":"zhangtemplar","id":5475267,"avatar_url":"https://avatars2.githubusercontent.com/u/5475267?v=4","gravatar_id":"","url":"https://api.github.com/users/zhangtemplar","html_url":"https://github.com/zhangtemplar","followers_url":"https://api.github.com/users/zhangtemplar/followers","following_url":"https://api.github.com/users/zhangtemplar/following{/other_user}","gists_url":"https://api.github.com/users/zhangtemplar/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangtemplar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangtemplar/subscriptions","organizations_url":"https://api.github.com/users/zhangtemplar/orgs","repos_url":"https://api.github.com/users/zhangtemplar/repos","events_url":"https://api.github.com/users/zhangtemplar/events{/privacy}","received_events_url":"https://api.github.com/users/zhangtemplar/received_events","type":"User","site_admin":false},"created_at":"2018-05-01T08:30:55Z","updated_at":"2018-05-01T08:30:55Z","author_association":"CONTRIBUTOR","body":"I would suggest either you use four different variables for `$name`.\r\n\r\nOr you could create a pull request and implement your own solutions."}}
{"actor":{"display_login":"zhangtemplar"}}