{"action":"opened","number":112,"pull_request":{"url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/pulls/112","id":56696096,"html_url":"https://github.com/couchbaselabs/Linq2Couchbase/pull/112","diff_url":"https://github.com/couchbaselabs/Linq2Couchbase/pull/112.diff","patch_url":"https://github.com/couchbaselabs/Linq2Couchbase/pull/112.patch","issue_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/issues/112","number":112,"state":"open","locked":false,"title":"Issue #102: Aggregates after select projections","user":{"login":"brantburnett","id":7118719,"avatar_url":"https://avatars.githubusercontent.com/u/7118719?v=3","gravatar_id":"","url":"https://api.github.com/users/brantburnett","html_url":"https://github.com/brantburnett","followers_url":"https://api.github.com/users/brantburnett/followers","following_url":"https://api.github.com/users/brantburnett/following{/other_user}","gists_url":"https://api.github.com/users/brantburnett/gists{/gist_id}","starred_url":"https://api.github.com/users/brantburnett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brantburnett/subscriptions","organizations_url":"https://api.github.com/users/brantburnett/orgs","repos_url":"https://api.github.com/users/brantburnett/repos","events_url":"https://api.github.com/users/brantburnett/events{/privacy}","received_events_url":"https://api.github.com/users/brantburnett/received_events","type":"User","site_admin":false},"body":"Motivation\r\n----------\r\nIf you apply a select clause in LINQ, and then follow this with an\r\naggregate such as .Count(), the generated N1QL is invalid.  It is\r\nincluding syntax like \"`a` as `a`, `b` as `b`\" inside the COUNT()\r\nfunction.\r\n\r\nModifications\r\n-------------\r\nRecognize when a new object select statement is used within an aggregate.\r\nWhen encountered, use the JSON {...} new object syntax in N1QL.\r\n\r\nResults\r\n-------\r\nN1QL created is now valid and runs successfully.  Note that using the JSON\r\nnew object syntax like COUNT({a: b}) is more valid than simply always\r\nusing COUNT(*).  This is because it will work with other operations like\r\nCOUNT(DISTINCT {a: b}).","created_at":"2016-01-21T02:06:08Z","updated_at":"2016-01-21T02:06:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/pulls/112/commits","review_comments_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/pulls/112/comments","review_comment_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/pulls/comments{/number}","comments_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/issues/112/comments","statuses_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/statuses/aede6a6b2a9b71ab4593b4df1b4f89f355b93fa0","head":{"label":"brantburnett:issue102-countagainstprojection","ref":"issue102-countagainstprojection","sha":"aede6a6b2a9b71ab4593b4df1b4f89f355b93fa0","user":{"login":"brantburnett","id":7118719,"avatar_url":"https://avatars.githubusercontent.com/u/7118719?v=3","gravatar_id":"","url":"https://api.github.com/users/brantburnett","html_url":"https://github.com/brantburnett","followers_url":"https://api.github.com/users/brantburnett/followers","following_url":"https://api.github.com/users/brantburnett/following{/other_user}","gists_url":"https://api.github.com/users/brantburnett/gists{/gist_id}","starred_url":"https://api.github.com/users/brantburnett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brantburnett/subscriptions","organizations_url":"https://api.github.com/users/brantburnett/orgs","repos_url":"https://api.github.com/users/brantburnett/repos","events_url":"https://api.github.com/users/brantburnett/events{/privacy}","received_events_url":"https://api.github.com/users/brantburnett/received_events","type":"User","site_admin":false},"repo":{"id":36899716,"name":"Linq2Couchbase","full_name":"brantburnett/Linq2Couchbase","owner":{"login":"brantburnett","id":7118719,"avatar_url":"https://avatars.githubusercontent.com/u/7118719?v=3","gravatar_id":"","url":"https://api.github.com/users/brantburnett","html_url":"https://github.com/brantburnett","followers_url":"https://api.github.com/users/brantburnett/followers","following_url":"https://api.github.com/users/brantburnett/following{/other_user}","gists_url":"https://api.github.com/users/brantburnett/gists{/gist_id}","starred_url":"https://api.github.com/users/brantburnett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brantburnett/subscriptions","organizations_url":"https://api.github.com/users/brantburnett/orgs","repos_url":"https://api.github.com/users/brantburnett/repos","events_url":"https://api.github.com/users/brantburnett/events{/privacy}","received_events_url":"https://api.github.com/users/brantburnett/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brantburnett/Linq2Couchbase","description":"A Language Integrated Query (LINQ) provider for the Couchbase .NET SDK","fork":true,"url":"https://api.github.com/repos/brantburnett/Linq2Couchbase","forks_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/forks","keys_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/teams","hooks_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/hooks","issue_events_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/issues/events{/number}","events_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/events","assignees_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/assignees{/user}","branches_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/branches{/branch}","tags_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/tags","blobs_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/git/refs{/sha}","trees_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/statuses/{sha}","languages_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/languages","stargazers_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/stargazers","contributors_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/contributors","subscribers_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/subscribers","subscription_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/subscription","commits_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/commits{/sha}","git_commits_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/git/commits{/sha}","comments_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/comments{/number}","issue_comment_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/issues/comments{/number}","contents_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/contents/{+path}","compare_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/merges","archive_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/downloads","issues_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/issues{/number}","pulls_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/pulls{/number}","milestones_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/milestones{/number}","notifications_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/labels{/name}","releases_url":"https://api.github.com/repos/brantburnett/Linq2Couchbase/releases{/id}","created_at":"2015-06-04T22:50:39Z","updated_at":"2016-01-17T18:04:47Z","pushed_at":"2016-01-21T02:05:38Z","git_url":"git://github.com/brantburnett/Linq2Couchbase.git","ssh_url":"git@github.com:brantburnett/Linq2Couchbase.git","clone_url":"https://github.com/brantburnett/Linq2Couchbase.git","svn_url":"https://github.com/brantburnett/Linq2Couchbase","homepage":null,"size":1048,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"couchbaselabs:master","ref":"master","sha":"46b00d3526f3f501fdc0a5883bb41be0c0e6d91e","user":{"login":"couchbaselabs","id":636956,"avatar_url":"https://avatars.githubusercontent.com/u/636956?v=3","gravatar_id":"","url":"https://api.github.com/users/couchbaselabs","html_url":"https://github.com/couchbaselabs","followers_url":"https://api.github.com/users/couchbaselabs/followers","following_url":"https://api.github.com/users/couchbaselabs/following{/other_user}","gists_url":"https://api.github.com/users/couchbaselabs/gists{/gist_id}","starred_url":"https://api.github.com/users/couchbaselabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/couchbaselabs/subscriptions","organizations_url":"https://api.github.com/users/couchbaselabs/orgs","repos_url":"https://api.github.com/users/couchbaselabs/repos","events_url":"https://api.github.com/users/couchbaselabs/events{/privacy}","received_events_url":"https://api.github.com/users/couchbaselabs/received_events","type":"Organization","site_admin":false},"repo":{"id":24389293,"name":"Linq2Couchbase","full_name":"couchbaselabs/Linq2Couchbase","owner":{"login":"couchbaselabs","id":636956,"avatar_url":"https://avatars.githubusercontent.com/u/636956?v=3","gravatar_id":"","url":"https://api.github.com/users/couchbaselabs","html_url":"https://github.com/couchbaselabs","followers_url":"https://api.github.com/users/couchbaselabs/followers","following_url":"https://api.github.com/users/couchbaselabs/following{/other_user}","gists_url":"https://api.github.com/users/couchbaselabs/gists{/gist_id}","starred_url":"https://api.github.com/users/couchbaselabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/couchbaselabs/subscriptions","organizations_url":"https://api.github.com/users/couchbaselabs/orgs","repos_url":"https://api.github.com/users/couchbaselabs/repos","events_url":"https://api.github.com/users/couchbaselabs/events{/privacy}","received_events_url":"https://api.github.com/users/couchbaselabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/couchbaselabs/Linq2Couchbase","description":"A Language Integrated Query (LINQ) provider for the Couchbase .NET SDK","fork":false,"url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase","forks_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/forks","keys_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/teams","hooks_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/hooks","issue_events_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/issues/events{/number}","events_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/events","assignees_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/assignees{/user}","branches_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/branches{/branch}","tags_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/tags","blobs_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/git/refs{/sha}","trees_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/statuses/{sha}","languages_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/languages","stargazers_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/stargazers","contributors_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/contributors","subscribers_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/subscribers","subscription_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/subscription","commits_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/commits{/sha}","git_commits_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/git/commits{/sha}","comments_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/comments{/number}","issue_comment_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/issues/comments{/number}","contents_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/contents/{+path}","compare_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/merges","archive_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/downloads","issues_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/issues{/number}","pulls_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/pulls{/number}","milestones_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/milestones{/number}","notifications_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/labels{/name}","releases_url":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/releases{/id}","created_at":"2014-09-23T21:02:02Z","updated_at":"2016-01-12T18:08:15Z","pushed_at":"2016-01-21T01:04:07Z","git_url":"git://github.com/couchbaselabs/Linq2Couchbase.git","ssh_url":"git@github.com:couchbaselabs/Linq2Couchbase.git","clone_url":"https://github.com/couchbaselabs/Linq2Couchbase.git","svn_url":"https://github.com/couchbaselabs/Linq2Couchbase","homepage":null,"size":1050,"stargazers_count":18,"watchers_count":18,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":3,"forks":12,"open_issues":3,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/pulls/112"},"html":{"href":"https://github.com/couchbaselabs/Linq2Couchbase/pull/112"},"issue":{"href":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/issues/112"},"comments":{"href":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/issues/112/comments"},"review_comments":{"href":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/pulls/112/comments"},"review_comment":{"href":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/pulls/112/commits"},"statuses":{"href":"https://api.github.com/repos/couchbaselabs/Linq2Couchbase/statuses/aede6a6b2a9b71ab4593b4df1b4f89f355b93fa0"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":46,"deletions":10,"changed_files":2}}