{"action":"closed","issue":{"url":"https://api.github.com/repos/aldeed/meteor-tabular/issues/240","labels_url":"https://api.github.com/repos/aldeed/meteor-tabular/issues/240/labels{/name}","comments_url":"https://api.github.com/repos/aldeed/meteor-tabular/issues/240/comments","events_url":"https://api.github.com/repos/aldeed/meteor-tabular/issues/240/events","html_url":"https://github.com/aldeed/meteor-tabular/issues/240","id":117530752,"number":240,"title":"How to pass parameters to publish function?","user":{"login":"tab00","id":12715448,"avatar_url":"https://avatars.githubusercontent.com/u/12715448?v=3","gravatar_id":"","url":"https://api.github.com/users/tab00","html_url":"https://github.com/tab00","followers_url":"https://api.github.com/users/tab00/followers","following_url":"https://api.github.com/users/tab00/following{/other_user}","gists_url":"https://api.github.com/users/tab00/gists{/gist_id}","starred_url":"https://api.github.com/users/tab00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tab00/subscriptions","organizations_url":"https://api.github.com/users/tab00/orgs","repos_url":"https://api.github.com/users/tab00/repos","events_url":"https://api.github.com/users/tab00/events{/privacy}","received_events_url":"https://api.github.com/users/tab00/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-18T07:30:40Z","updated_at":"2016-01-08T04:30:58Z","closed_at":"2016-01-08T04:30:58Z","body":"Before using meteor-tabular this was my publish function:\r\n```\r\nMeteor.publish(\"PageItems\", function (pageId) {\r\n    check(pageId, String);\r\n\r\n    return PageItems.find({ pageId: pageId });\r\n});\r\n```\r\n\r\nTo use meteor-tabular I changed it to:\r\n```\r\nMeteor.publish(\"Tabular_PageItems\", function (tableName, ids, fields) {\r\n  check(tableName, String);\r\n  check(ids, Array);\r\n  check(fields, Match.Optional(Object));\r\n\r\n    return PageItems.find({ pageId: pageId });\r\n});\r\n```\r\nHowever pageId would be undefined. So how can I pass pageId into the publish function in order to limit the results being subscribed to?\r\n\r\nThere doesn't seem to be any way to pass parameters when subscribing:\r\n```\r\nTabularTables.Pages = new Tabular.Table({\r\n    name: \"Pages\",\r\n    collection: Pages,\r\n    pub: \"Tabular_PageItems\",\r\n```\r\n\r\nI know that it's possible to subscribe to the entire collection and filter on the client, however that would be a security risk and inefficient. Only what is needed by the client should be subscribed to and nothing more.\r\n"}}