{"action":"created","issue":{"url":"https://api.github.com/repos/Lepozepo/meteor-publish-with-relations/issues/2","labels_url":"https://api.github.com/repos/Lepozepo/meteor-publish-with-relations/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/Lepozepo/meteor-publish-with-relations/issues/2/comments","events_url":"https://api.github.com/repos/Lepozepo/meteor-publish-with-relations/issues/2/events","html_url":"https://github.com/Lepozepo/meteor-publish-with-relations/issues/2","id":78260363,"number":2,"title":"Clarify README example","user":{"login":"lorensr","id":251288,"avatar_url":"https://avatars.githubusercontent.com/u/251288?v=3","gravatar_id":"","url":"https://api.github.com/users/lorensr","html_url":"https://github.com/lorensr","followers_url":"https://api.github.com/users/lorensr/followers","following_url":"https://api.github.com/users/lorensr/following{/other_user}","gists_url":"https://api.github.com/users/lorensr/gists{/gist_id}","starred_url":"https://api.github.com/users/lorensr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorensr/subscriptions","organizations_url":"https://api.github.com/users/lorensr/orgs","repos_url":"https://api.github.com/users/lorensr/repos","events_url":"https://api.github.com/users/lorensr/events{/privacy}","received_events_url":"https://api.github.com/users/lorensr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-05-19T21:37:54Z","updated_at":"2015-05-20T07:58:43Z","closed_at":"2015-05-19T22:01:49Z","body":"Thanks for publishing this fork! I think it would be clearer if the example used more features and was on a topic, similar to the original package. I'm not sure what `foreign_key:\"sub_things.deep_things.deep_thing\"` means – is that a nested Mongodb object, or a series of keys, each in a different collection? For instance for this model:\r\n\r\n```\r\nMeteor.users\r\n  _id\r\n  profile\r\n    name\r\n      first\r\n      last\r\n    bioId\r\n\r\nPosts\r\n  userId\r\n\r\nComments\r\n  postId\r\n  userId\r\n```\r\n\r\nIs this correct?\r\n\r\n```coffeescript\r\n# a user, their bio, their posts, their posts' most recent approved comments,\r\n# and those comments' users\r\nMeteor.publish \"user\", (userId) ->\r\n  Meteor.publishWithRelations\r\n    handle: this\r\n    collection: Meteor.users\r\n    filter: userId\r\n    mappings: [\r\n      {\r\n        key: \"profile.bioId\"\r\n        collection: Bios\r\n      }\r\n      {\r\n        foreign_key: \"userId\"\r\n        collection: Posts\r\n        mappings: [\r\n          {\r\n            foreign_key: \"postId\"\r\n            collection: Comments\r\n            filter: { approved: true }\r\n            options: {\r\n              limit: 10,\r\n              sort: { createdAt: -1 }\r\n            }\r\n            mappings: [\r\n              {\r\n                key: \"userId\"\r\n                collection: Meteor.users\r\n              }\r\n            ]\r\n          }\r\n        ]\r\n      }\r\n    ]\r\n```\r\n\r\nAlso, the README says there is support for arrays, but doesn't give an example of how that is formatted. This is an array of ids? Eg if the Posts/Comments relationship was changed to:\r\n\r\n```\r\nPosts\r\n  userId\r\n  comments # array of Comments._id\r\n\r\nComments\r\n  userId\r\n```\r\n\r\nwould the mapping be this?\r\n\r\n```coffeescript\r\n{\r\n  foreign_key: \"userId\"\r\n  collection: Posts\r\n  mappings: [\r\n    {\r\n      key: \"comments\"\r\n      collection: Comments\r\n    }\r\n  ]\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/Lepozepo/meteor-publish-with-relations/issues/comments/103800744","html_url":"https://github.com/Lepozepo/meteor-publish-with-relations/issues/2#issuecomment-103800744","issue_url":"https://api.github.com/repos/Lepozepo/meteor-publish-with-relations/issues/2","id":103800744,"user":{"login":"Lepozepo","id":2302110,"avatar_url":"https://avatars.githubusercontent.com/u/2302110?v=3","gravatar_id":"","url":"https://api.github.com/users/Lepozepo","html_url":"https://github.com/Lepozepo","followers_url":"https://api.github.com/users/Lepozepo/followers","following_url":"https://api.github.com/users/Lepozepo/following{/other_user}","gists_url":"https://api.github.com/users/Lepozepo/gists{/gist_id}","starred_url":"https://api.github.com/users/Lepozepo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lepozepo/subscriptions","organizations_url":"https://api.github.com/users/Lepozepo/orgs","repos_url":"https://api.github.com/users/Lepozepo/repos","events_url":"https://api.github.com/users/Lepozepo/events{/privacy}","received_events_url":"https://api.github.com/users/Lepozepo/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T07:58:43Z","updated_at":"2015-05-20T07:58:43Z","body":"But honestly, I don't think you need reactivity for that part unless you think people will often be changing who they follow while they observe the games for the people they follow, right?"}}