{"action":"created","issue":{"url":"https://api.github.com/repos/dburles/meteor-collection-helpers/issues/23","labels_url":"https://api.github.com/repos/dburles/meteor-collection-helpers/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/dburles/meteor-collection-helpers/issues/23/comments","events_url":"https://api.github.com/repos/dburles/meteor-collection-helpers/issues/23/events","html_url":"https://github.com/dburles/meteor-collection-helpers/issues/23","id":54427922,"number":23,"title":"Maximum Collection Supported","user":{"login":"ralphievolt","id":5282658,"avatar_url":"https://avatars.githubusercontent.com/u/5282658?v=3","gravatar_id":"","url":"https://api.github.com/users/ralphievolt","html_url":"https://github.com/ralphievolt","followers_url":"https://api.github.com/users/ralphievolt/followers","following_url":"https://api.github.com/users/ralphievolt/following{/other_user}","gists_url":"https://api.github.com/users/ralphievolt/gists{/gist_id}","starred_url":"https://api.github.com/users/ralphievolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ralphievolt/subscriptions","organizations_url":"https://api.github.com/users/ralphievolt/orgs","repos_url":"https://api.github.com/users/ralphievolt/repos","events_url":"https://api.github.com/users/ralphievolt/events{/privacy}","received_events_url":"https://api.github.com/users/ralphievolt/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-01-15T09:25:46Z","updated_at":"2015-01-16T05:51:21Z","closed_at":"2015-01-15T22:31:35Z","body":"What is the maximum collection I can join together with this package? I have 6 collection which are referenced with each other. Can I used it?"},"comment":{"url":"https://api.github.com/repos/dburles/meteor-collection-helpers/issues/comments/70211421","html_url":"https://github.com/dburles/meteor-collection-helpers/issues/23#issuecomment-70211421","issue_url":"https://api.github.com/repos/dburles/meteor-collection-helpers/issues/23","id":70211421,"user":{"login":"dburles","id":319567,"avatar_url":"https://avatars.githubusercontent.com/u/319567?v=3","gravatar_id":"","url":"https://api.github.com/users/dburles","html_url":"https://github.com/dburles","followers_url":"https://api.github.com/users/dburles/followers","following_url":"https://api.github.com/users/dburles/following{/other_user}","gists_url":"https://api.github.com/users/dburles/gists{/gist_id}","starred_url":"https://api.github.com/users/dburles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dburles/subscriptions","organizations_url":"https://api.github.com/users/dburles/orgs","repos_url":"https://api.github.com/users/dburles/repos","events_url":"https://api.github.com/users/dburles/events{/privacy}","received_events_url":"https://api.github.com/users/dburles/received_events","type":"User","site_admin":false},"created_at":"2015-01-16T05:51:21Z","updated_at":"2015-01-16T05:51:21Z","body":"Here's an example of a more complex structure, hopefully the relationships between authors, books and publishers is easy enough to understand.\r\n\r\n```js\r\nBooks = new Mongo.Collection('books');\r\nAuthors = new Mongo.Collection('authors');\r\nPublishers = new Mongo.Collection('publishers');\r\n\r\nBooks.helpers({\r\n  author: function() {\r\n    return Authors.findOne(this.authorId);\r\n  },\r\n  publisher: function() {\r\n    return Publishers.findOne(this.publisherId);\r\n  }\r\n});\r\n\r\nAuthors.helpers({\r\n  books: function() {\r\n    return Books.find({ authorId: this.authorId });\r\n  },\r\n  publishers: function() {\r\n    return Publishers.find({\r\n      _id: { $in: _.pluck(this.books.fetch(), 'publisherId') }});\r\n  }\r\n});\r\n\r\nPublishers.helpers({\r\n  books: function() {\r\n    return Books.find({ publisherId: this._id });\r\n  },\r\n  authors: function() {\r\n    return Authors.find({\r\n      _id: { $in: _.pluck(this.books().fetch(), 'authorId') }});\r\n  }\r\n});\r\n```"}}