{"action":"closed","number":20,"pull_request":{"url":"https://api.github.com/repos/Slava/meteor-rethinkdb/pulls/20","id":36077316,"html_url":"https://github.com/Slava/meteor-rethinkdb/pull/20","diff_url":"https://github.com/Slava/meteor-rethinkdb/pull/20.diff","patch_url":"https://github.com/Slava/meteor-rethinkdb/pull/20.patch","issue_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/issues/20","number":20,"state":"closed","locked":false,"title":"Publication improvements","user":{"login":"rclai","id":1316261,"avatar_url":"https://avatars.githubusercontent.com/u/1316261?v=3","gravatar_id":"","url":"https://api.github.com/users/rclai","html_url":"https://github.com/rclai","followers_url":"https://api.github.com/users/rclai/followers","following_url":"https://api.github.com/users/rclai/following{/other_user}","gists_url":"https://api.github.com/users/rclai/gists{/gist_id}","starred_url":"https://api.github.com/users/rclai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rclai/subscriptions","organizations_url":"https://api.github.com/users/rclai/orgs","repos_url":"https://api.github.com/users/rclai/repos","events_url":"https://api.github.com/users/rclai/events{/privacy}","received_events_url":"https://api.github.com/users/rclai/received_events","type":"User","site_admin":false},"body":"WIP.\r\n\r\nCan publish more stuff such as:\r\n\r\n```js\r\n.min()\r\n.max()\r\n.filter()\r\n// Apparently you have to do orderBy first before you filter, otherwise it doesn't work (https://github.com/rethinkdb/rethinkdb/issues/4266)\r\n.orderBy().filter().limit()\r\n.get()\r\n.pluck() // you need to at least have 'id' in there or you're screwed\r\n// This doesn't work unfortunately (https://github.com/rethinkdb/rethinkdb/issues/4267)\r\n// .get().pluck()\r\n.map()\r\n```\r\n\r\nI've also tried a mixture of the above with success. I'll document more.\r\n\r\nYou can also do things like:\r\n\r\n```js\r\nMeteor.publish('allCities', function () {\r\n  return Cities;\r\n});\r\n\r\nMeteor.publish('allCitiesAndStates', function () {\r\n  return [Cities, States];\r\n});\r\n\r\nMeteor.publish('citiesAndStatesMoreIntelligently', function () {\r\n  return [\r\n    Cities.orderBy({ index: 'id' }).limit(10), \r\n    States.filter({ region: 'northWest' })\r\n  ];\r\n});\r\n```\r\n\r\nUntested queries:\r\n\r\n```js\r\n.union()\r\n.between()\r\n```\r\n\r\nEssentially I was just going through [this list](http://rethinkdb.com/docs/changefeeds/javascript/) and testing them out.\r\n\r\nI haven't wrote tests yet.\r\n\r\nFYIs:\r\nEach session creates a change-feed. Don't know if it makes sense to share change-feeds per session maybe or does this go against mergebox implementations?\r\n\r\nAlso, is there any way on the server to make a `Rethink.Table` act like a `r.table`? If it wasn't for that `.filter({})` prefix, most of this wouldn't work.\r\n\r\nClient-side hasn't changed though.\r\n\r\nI tried to implement Michel's (neumino) new stuff but broke the current browserified build implementation because he made tons of changes.","created_at":"2015-05-22T23:44:27Z","updated_at":"2015-12-10T02:10:36Z","closed_at":"2015-12-10T02:10:36Z","merged_at":null,"merge_commit_sha":"9735a0103eec9cef075c08f69239a260e63c3cd1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/pulls/20/commits","review_comments_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/pulls/20/comments","review_comment_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/issues/20/comments","statuses_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/statuses/400d97282faded38bce1b1efcc46703e096ab71a","head":{"label":"Profab:publish-improve","ref":"publish-improve","sha":"400d97282faded38bce1b1efcc46703e096ab71a","user":{"login":"Profab","id":9386514,"avatar_url":"https://avatars.githubusercontent.com/u/9386514?v=3","gravatar_id":"","url":"https://api.github.com/users/Profab","html_url":"https://github.com/Profab","followers_url":"https://api.github.com/users/Profab/followers","following_url":"https://api.github.com/users/Profab/following{/other_user}","gists_url":"https://api.github.com/users/Profab/gists{/gist_id}","starred_url":"https://api.github.com/users/Profab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Profab/subscriptions","organizations_url":"https://api.github.com/users/Profab/orgs","repos_url":"https://api.github.com/users/Profab/repos","events_url":"https://api.github.com/users/Profab/events{/privacy}","received_events_url":"https://api.github.com/users/Profab/received_events","type":"Organization","site_admin":false},"repo":{"id":35886862,"name":"meteor-rethinkdb","full_name":"Profab/meteor-rethinkdb","owner":{"login":"Profab","id":9386514,"avatar_url":"https://avatars.githubusercontent.com/u/9386514?v=3","gravatar_id":"","url":"https://api.github.com/users/Profab","html_url":"https://github.com/Profab","followers_url":"https://api.github.com/users/Profab/followers","following_url":"https://api.github.com/users/Profab/following{/other_user}","gists_url":"https://api.github.com/users/Profab/gists{/gist_id}","starred_url":"https://api.github.com/users/Profab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Profab/subscriptions","organizations_url":"https://api.github.com/users/Profab/orgs","repos_url":"https://api.github.com/users/Profab/repos","events_url":"https://api.github.com/users/Profab/events{/privacy}","received_events_url":"https://api.github.com/users/Profab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Profab/meteor-rethinkdb","description":"RethinkDB integration for Meteor","fork":true,"url":"https://api.github.com/repos/Profab/meteor-rethinkdb","forks_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/forks","keys_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/teams","hooks_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/hooks","issue_events_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/issues/events{/number}","events_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/events","assignees_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/assignees{/user}","branches_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/branches{/branch}","tags_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/tags","blobs_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/statuses/{sha}","languages_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/languages","stargazers_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/stargazers","contributors_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/contributors","subscribers_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/subscribers","subscription_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/subscription","commits_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/contents/{+path}","compare_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/merges","archive_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/downloads","issues_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/issues{/number}","pulls_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/pulls{/number}","milestones_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/milestones{/number}","notifications_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/labels{/name}","releases_url":"https://api.github.com/repos/Profab/meteor-rethinkdb/releases{/id}","created_at":"2015-05-19T14:20:37Z","updated_at":"2015-10-17T00:30:07Z","pushed_at":"2015-05-26T17:23:49Z","git_url":"git://github.com/Profab/meteor-rethinkdb.git","ssh_url":"git@github.com:Profab/meteor-rethinkdb.git","clone_url":"https://github.com/Profab/meteor-rethinkdb.git","svn_url":"https://github.com/Profab/meteor-rethinkdb","homepage":"https://atmospherejs.com/simple/rethink","size":632,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"publish-improve"}},"base":{"label":"Slava:master","ref":"master","sha":"e4fb0bb62376100b27497958fc2554b66e3000e9","user":{"login":"Slava","id":2608446,"avatar_url":"https://avatars.githubusercontent.com/u/2608446?v=3","gravatar_id":"","url":"https://api.github.com/users/Slava","html_url":"https://github.com/Slava","followers_url":"https://api.github.com/users/Slava/followers","following_url":"https://api.github.com/users/Slava/following{/other_user}","gists_url":"https://api.github.com/users/Slava/gists{/gist_id}","starred_url":"https://api.github.com/users/Slava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Slava/subscriptions","organizations_url":"https://api.github.com/users/Slava/orgs","repos_url":"https://api.github.com/users/Slava/repos","events_url":"https://api.github.com/users/Slava/events{/privacy}","received_events_url":"https://api.github.com/users/Slava/received_events","type":"User","site_admin":false},"repo":{"id":34434221,"name":"meteor-rethinkdb","full_name":"Slava/meteor-rethinkdb","owner":{"login":"Slava","id":2608446,"avatar_url":"https://avatars.githubusercontent.com/u/2608446?v=3","gravatar_id":"","url":"https://api.github.com/users/Slava","html_url":"https://github.com/Slava","followers_url":"https://api.github.com/users/Slava/followers","following_url":"https://api.github.com/users/Slava/following{/other_user}","gists_url":"https://api.github.com/users/Slava/gists{/gist_id}","starred_url":"https://api.github.com/users/Slava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Slava/subscriptions","organizations_url":"https://api.github.com/users/Slava/orgs","repos_url":"https://api.github.com/users/Slava/repos","events_url":"https://api.github.com/users/Slava/events{/privacy}","received_events_url":"https://api.github.com/users/Slava/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Slava/meteor-rethinkdb","description":"RethinkDB integration for Meteor","fork":false,"url":"https://api.github.com/repos/Slava/meteor-rethinkdb","forks_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/forks","keys_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/teams","hooks_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/hooks","issue_events_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/issues/events{/number}","events_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/events","assignees_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/assignees{/user}","branches_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/branches{/branch}","tags_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/tags","blobs_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/statuses/{sha}","languages_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/languages","stargazers_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/stargazers","contributors_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/contributors","subscribers_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/subscribers","subscription_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/subscription","commits_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/contents/{+path}","compare_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/merges","archive_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/downloads","issues_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/issues{/number}","pulls_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/pulls{/number}","milestones_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/milestones{/number}","notifications_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/labels{/name}","releases_url":"https://api.github.com/repos/Slava/meteor-rethinkdb/releases{/id}","created_at":"2015-04-23T04:46:11Z","updated_at":"2015-12-10T00:09:13Z","pushed_at":"2015-11-18T15:11:28Z","git_url":"git://github.com/Slava/meteor-rethinkdb.git","ssh_url":"git@github.com:Slava/meteor-rethinkdb.git","clone_url":"https://github.com/Slava/meteor-rethinkdb.git","svn_url":"https://github.com/Slava/meteor-rethinkdb","homepage":"https://atmospherejs.com/simple/rethink","size":496,"stargazers_count":239,"watchers_count":239,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":11,"forks":14,"open_issues":11,"watchers":239,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Slava/meteor-rethinkdb/pulls/20"},"html":{"href":"https://github.com/Slava/meteor-rethinkdb/pull/20"},"issue":{"href":"https://api.github.com/repos/Slava/meteor-rethinkdb/issues/20"},"comments":{"href":"https://api.github.com/repos/Slava/meteor-rethinkdb/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/Slava/meteor-rethinkdb/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/Slava/meteor-rethinkdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Slava/meteor-rethinkdb/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/Slava/meteor-rethinkdb/statuses/400d97282faded38bce1b1efcc46703e096ab71a"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":4,"review_comments":0,"commits":13,"additions":154,"deletions":89,"changed_files":3}}