{"action":"created","comment":{"url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/comments/46361424","id":46361424,"diff_hunk":"@@ -67,20 +68,53 @@ class EvaluatorSpec extends Specification with DisjunctionMatchers {\n             |\"\"\".stripMargin)\n     }\n \n-    \"write simple pipeline workflow to JS\" in {\n+    \"write simple query to JS\" in {\n       val wf = chain(\n         $read(Collection(\"db\", \"zips\")),\n         $match(Selector.Doc(\n           BsonField.Name(\"pop\") -> Selector.Gte(Bson.Int64(1000)))))\n \n       MongoDbEvaluator.toJS(crystallize(wf)) must beRightDisjunction(\n+        \"\"\"db.zips.find({ \"pop\": { \"$gte\": NumberLong(1000) } });\n+          |\"\"\".stripMargin)\n+    }\n+\n+    \"write simple count to JS\" in {\n+      val wf = chain(\n+        $read(Collection(\"db\", \"zips\")),\n+        $match(Selector.Doc(\n+          BsonField.Name(\"pop\") -> Selector.Gte(Bson.Int64(1000)))),\n+        $group(\n+          Grouped(ListMap(\n+            BsonField.Name(\"num\") -> $sum($literal(Bson.Int64(1))))),\n+          $literal(Bson.Null).right))\n+\n+      MongoDbEvaluator.toJS(crystallize(wf)) must beRightDisjunction(\n+        \"\"\"{ \"num\": db.zips.count({ \"pop\": { \"$gte\": NumberLong(1000) } }) };","path":"core/src/test/scala/quasar/physical/mongodb/evaluator.scala","position":44,"original_position":44,"commit_id":"3a8ac34fe34a3d72f4e3bf31fa8403692406e24e","original_commit_id":"3a8ac34fe34a3d72f4e3bf31fa8403692406e24e","user":{"login":"mossprescott","id":6147371,"avatar_url":"https://avatars.githubusercontent.com/u/6147371?v=3","gravatar_id":"","url":"https://api.github.com/users/mossprescott","html_url":"https://github.com/mossprescott","followers_url":"https://api.github.com/users/mossprescott/followers","following_url":"https://api.github.com/users/mossprescott/following{/other_user}","gists_url":"https://api.github.com/users/mossprescott/gists{/gist_id}","starred_url":"https://api.github.com/users/mossprescott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mossprescott/subscriptions","organizations_url":"https://api.github.com/users/mossprescott/orgs","repos_url":"https://api.github.com/users/mossprescott/repos","events_url":"https://api.github.com/users/mossprescott/events{/privacy}","received_events_url":"https://api.github.com/users/mossprescott/received_events","type":"User","site_admin":false},"body":"Correction: it may or may not be correct JS, but it doesn't work in the mongo shell:\r\n\r\n```\r\n> { a: 1 }\r\n1\r\n> foo = { a: 1 }\r\n{ \"a\" : 1 }\r\n> [ { a: 1 } ]\r\n[ { \"a\" : 1 } ]\r\n```","created_at":"2015-12-02T00:22:28Z","updated_at":"2015-12-02T00:22:28Z","html_url":"https://github.com/quasar-analytics/quasar/pull/1019#discussion_r46361424","pull_request_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1019","_links":{"self":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/comments/46361424"},"html":{"href":"https://github.com/quasar-analytics/quasar/pull/1019#discussion_r46361424"},"pull_request":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1019"}}},"pull_request":{"url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1019","id":52334982,"html_url":"https://github.com/quasar-analytics/quasar/pull/1019","diff_url":"https://github.com/quasar-analytics/quasar/pull/1019.diff","patch_url":"https://github.com/quasar-analytics/quasar/pull/1019.patch","issue_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/1019","number":1019,"state":"open","locked":false,"title":"Implement find() and count().","user":{"login":"sellout","id":33031,"avatar_url":"https://avatars.githubusercontent.com/u/33031?v=3","gravatar_id":"","url":"https://api.github.com/users/sellout","html_url":"https://github.com/sellout","followers_url":"https://api.github.com/users/sellout/followers","following_url":"https://api.github.com/users/sellout/following{/other_user}","gists_url":"https://api.github.com/users/sellout/gists{/gist_id}","starred_url":"https://api.github.com/users/sellout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sellout/subscriptions","organizations_url":"https://api.github.com/users/sellout/orgs","repos_url":"https://api.github.com/users/sellout/repos","events_url":"https://api.github.com/users/sellout/events{/privacy}","received_events_url":"https://api.github.com/users/sellout/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-01T23:58:27Z","updated_at":"2015-12-02T00:22:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ead8b449c01ea12afd216ff864cbfc7d5b7ed68","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1019/commits","review_comments_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1019/comments","review_comment_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/1019/comments","statuses_url":"https://api.github.com/repos/quasar-analytics/quasar/statuses/3a8ac34fe34a3d72f4e3bf31fa8403692406e24e","head":{"label":"sellout:SD-954-implement-find","ref":"SD-954-implement-find","sha":"3a8ac34fe34a3d72f4e3bf31fa8403692406e24e","user":{"login":"sellout","id":33031,"avatar_url":"https://avatars.githubusercontent.com/u/33031?v=3","gravatar_id":"","url":"https://api.github.com/users/sellout","html_url":"https://github.com/sellout","followers_url":"https://api.github.com/users/sellout/followers","following_url":"https://api.github.com/users/sellout/following{/other_user}","gists_url":"https://api.github.com/users/sellout/gists{/gist_id}","starred_url":"https://api.github.com/users/sellout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sellout/subscriptions","organizations_url":"https://api.github.com/users/sellout/orgs","repos_url":"https://api.github.com/users/sellout/repos","events_url":"https://api.github.com/users/sellout/events{/privacy}","received_events_url":"https://api.github.com/users/sellout/received_events","type":"User","site_admin":false},"repo":{"id":21178230,"name":"slamengine","full_name":"sellout/slamengine","owner":{"login":"sellout","id":33031,"avatar_url":"https://avatars.githubusercontent.com/u/33031?v=3","gravatar_id":"","url":"https://api.github.com/users/sellout","html_url":"https://github.com/sellout","followers_url":"https://api.github.com/users/sellout/followers","following_url":"https://api.github.com/users/sellout/following{/other_user}","gists_url":"https://api.github.com/users/sellout/gists{/gist_id}","starred_url":"https://api.github.com/users/sellout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sellout/subscriptions","organizations_url":"https://api.github.com/users/sellout/orgs","repos_url":"https://api.github.com/users/sellout/repos","events_url":"https://api.github.com/users/sellout/events{/privacy}","received_events_url":"https://api.github.com/users/sellout/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sellout/slamengine","description":"The engine for SlamData","fork":true,"url":"https://api.github.com/repos/sellout/slamengine","forks_url":"https://api.github.com/repos/sellout/slamengine/forks","keys_url":"https://api.github.com/repos/sellout/slamengine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sellout/slamengine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sellout/slamengine/teams","hooks_url":"https://api.github.com/repos/sellout/slamengine/hooks","issue_events_url":"https://api.github.com/repos/sellout/slamengine/issues/events{/number}","events_url":"https://api.github.com/repos/sellout/slamengine/events","assignees_url":"https://api.github.com/repos/sellout/slamengine/assignees{/user}","branches_url":"https://api.github.com/repos/sellout/slamengine/branches{/branch}","tags_url":"https://api.github.com/repos/sellout/slamengine/tags","blobs_url":"https://api.github.com/repos/sellout/slamengine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sellout/slamengine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sellout/slamengine/git/refs{/sha}","trees_url":"https://api.github.com/repos/sellout/slamengine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sellout/slamengine/statuses/{sha}","languages_url":"https://api.github.com/repos/sellout/slamengine/languages","stargazers_url":"https://api.github.com/repos/sellout/slamengine/stargazers","contributors_url":"https://api.github.com/repos/sellout/slamengine/contributors","subscribers_url":"https://api.github.com/repos/sellout/slamengine/subscribers","subscription_url":"https://api.github.com/repos/sellout/slamengine/subscription","commits_url":"https://api.github.com/repos/sellout/slamengine/commits{/sha}","git_commits_url":"https://api.github.com/repos/sellout/slamengine/git/commits{/sha}","comments_url":"https://api.github.com/repos/sellout/slamengine/comments{/number}","issue_comment_url":"https://api.github.com/repos/sellout/slamengine/issues/comments{/number}","contents_url":"https://api.github.com/repos/sellout/slamengine/contents/{+path}","compare_url":"https://api.github.com/repos/sellout/slamengine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sellout/slamengine/merges","archive_url":"https://api.github.com/repos/sellout/slamengine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sellout/slamengine/downloads","issues_url":"https://api.github.com/repos/sellout/slamengine/issues{/number}","pulls_url":"https://api.github.com/repos/sellout/slamengine/pulls{/number}","milestones_url":"https://api.github.com/repos/sellout/slamengine/milestones{/number}","notifications_url":"https://api.github.com/repos/sellout/slamengine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sellout/slamengine/labels{/name}","releases_url":"https://api.github.com/repos/sellout/slamengine/releases{/id}","created_at":"2014-06-24T19:38:07Z","updated_at":"2014-09-08T15:39:05Z","pushed_at":"2015-12-01T23:57:59Z","git_url":"git://github.com/sellout/slamengine.git","ssh_url":"git@github.com:sellout/slamengine.git","clone_url":"https://github.com/sellout/slamengine.git","svn_url":"https://github.com/sellout/slamengine","homepage":null,"size":8068,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"quasar-analytics:master","ref":"master","sha":"329e4f7368002ed852910f7fbaffe61e33a347b7","user":{"login":"quasar-analytics","id":15095906,"avatar_url":"https://avatars.githubusercontent.com/u/15095906?v=3","gravatar_id":"","url":"https://api.github.com/users/quasar-analytics","html_url":"https://github.com/quasar-analytics","followers_url":"https://api.github.com/users/quasar-analytics/followers","following_url":"https://api.github.com/users/quasar-analytics/following{/other_user}","gists_url":"https://api.github.com/users/quasar-analytics/gists{/gist_id}","starred_url":"https://api.github.com/users/quasar-analytics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quasar-analytics/subscriptions","organizations_url":"https://api.github.com/users/quasar-analytics/orgs","repos_url":"https://api.github.com/users/quasar-analytics/repos","events_url":"https://api.github.com/users/quasar-analytics/events{/privacy}","received_events_url":"https://api.github.com/users/quasar-analytics/received_events","type":"Organization","site_admin":false},"repo":{"id":16515058,"name":"quasar","full_name":"quasar-analytics/quasar","owner":{"login":"quasar-analytics","id":15095906,"avatar_url":"https://avatars.githubusercontent.com/u/15095906?v=3","gravatar_id":"","url":"https://api.github.com/users/quasar-analytics","html_url":"https://github.com/quasar-analytics","followers_url":"https://api.github.com/users/quasar-analytics/followers","following_url":"https://api.github.com/users/quasar-analytics/following{/other_user}","gists_url":"https://api.github.com/users/quasar-analytics/gists{/gist_id}","starred_url":"https://api.github.com/users/quasar-analytics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quasar-analytics/subscriptions","organizations_url":"https://api.github.com/users/quasar-analytics/orgs","repos_url":"https://api.github.com/users/quasar-analytics/repos","events_url":"https://api.github.com/users/quasar-analytics/events{/privacy}","received_events_url":"https://api.github.com/users/quasar-analytics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/quasar-analytics/quasar","description":"A NoSQL analytics engine that embraces post-relational analytics and pushes computation to the data.","fork":false,"url":"https://api.github.com/repos/quasar-analytics/quasar","forks_url":"https://api.github.com/repos/quasar-analytics/quasar/forks","keys_url":"https://api.github.com/repos/quasar-analytics/quasar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quasar-analytics/quasar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quasar-analytics/quasar/teams","hooks_url":"https://api.github.com/repos/quasar-analytics/quasar/hooks","issue_events_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/events{/number}","events_url":"https://api.github.com/repos/quasar-analytics/quasar/events","assignees_url":"https://api.github.com/repos/quasar-analytics/quasar/assignees{/user}","branches_url":"https://api.github.com/repos/quasar-analytics/quasar/branches{/branch}","tags_url":"https://api.github.com/repos/quasar-analytics/quasar/tags","blobs_url":"https://api.github.com/repos/quasar-analytics/quasar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quasar-analytics/quasar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quasar-analytics/quasar/git/refs{/sha}","trees_url":"https://api.github.com/repos/quasar-analytics/quasar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quasar-analytics/quasar/statuses/{sha}","languages_url":"https://api.github.com/repos/quasar-analytics/quasar/languages","stargazers_url":"https://api.github.com/repos/quasar-analytics/quasar/stargazers","contributors_url":"https://api.github.com/repos/quasar-analytics/quasar/contributors","subscribers_url":"https://api.github.com/repos/quasar-analytics/quasar/subscribers","subscription_url":"https://api.github.com/repos/quasar-analytics/quasar/subscription","commits_url":"https://api.github.com/repos/quasar-analytics/quasar/commits{/sha}","git_commits_url":"https://api.github.com/repos/quasar-analytics/quasar/git/commits{/sha}","comments_url":"https://api.github.com/repos/quasar-analytics/quasar/comments{/number}","issue_comment_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/comments{/number}","contents_url":"https://api.github.com/repos/quasar-analytics/quasar/contents/{+path}","compare_url":"https://api.github.com/repos/quasar-analytics/quasar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quasar-analytics/quasar/merges","archive_url":"https://api.github.com/repos/quasar-analytics/quasar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quasar-analytics/quasar/downloads","issues_url":"https://api.github.com/repos/quasar-analytics/quasar/issues{/number}","pulls_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls{/number}","milestones_url":"https://api.github.com/repos/quasar-analytics/quasar/milestones{/number}","notifications_url":"https://api.github.com/repos/quasar-analytics/quasar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quasar-analytics/quasar/labels{/name}","releases_url":"https://api.github.com/repos/quasar-analytics/quasar/releases{/id}","created_at":"2014-02-04T15:01:27Z","updated_at":"2015-11-20T19:02:33Z","pushed_at":"2015-12-01T23:58:29Z","git_url":"git://github.com/quasar-analytics/quasar.git","ssh_url":"git@github.com:quasar-analytics/quasar.git","clone_url":"https://github.com/quasar-analytics/quasar.git","svn_url":"https://github.com/quasar-analytics/quasar","homepage":"","size":8369,"stargazers_count":164,"watchers_count":164,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":160,"forks":38,"open_issues":160,"watchers":164,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1019"},"html":{"href":"https://github.com/quasar-analytics/quasar/pull/1019"},"issue":{"href":"https://api.github.com/repos/quasar-analytics/quasar/issues/1019"},"comments":{"href":"https://api.github.com/repos/quasar-analytics/quasar/issues/1019/comments"},"review_comments":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1019/comments"},"review_comment":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1019/commits"},"statuses":{"href":"https://api.github.com/repos/quasar-analytics/quasar/statuses/3a8ac34fe34a3d72f4e3bf31fa8403692406e24e"}}}}