{"action":"opened","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/3416","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/3416/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/3416/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/3416/events","html_url":"https://github.com/sequelize/sequelize/issues/3416","id":64686705,"number":3416,"title":"Documenting the use of `through` in find with BelongsToMany association","user":{"login":"yonjah","id":1829789,"avatar_url":"https://avatars.githubusercontent.com/u/1829789?v=3","gravatar_id":"","url":"https://api.github.com/users/yonjah","html_url":"https://github.com/yonjah","followers_url":"https://api.github.com/users/yonjah/followers","following_url":"https://api.github.com/users/yonjah/following{/other_user}","gists_url":"https://api.github.com/users/yonjah/gists{/gist_id}","starred_url":"https://api.github.com/users/yonjah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yonjah/subscriptions","organizations_url":"https://api.github.com/users/yonjah/orgs","repos_url":"https://api.github.com/users/yonjah/repos","events_url":"https://api.github.com/users/yonjah/events{/privacy}","received_events_url":"https://api.github.com/users/yonjah/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-27T04:01:13Z","updated_at":"2015-03-27T04:01:13Z","closed_at":null,"body":"The only mention of this I could find was in -\r\nhttps://github.com/sequelize/sequelize/issues/3258\r\n\r\nI would suggest adding -\r\n\r\nWhen eager loading the through parameter can be used to define the required relations.\r\nThe following example will only fetch Projects that have been started -\r\n\r\n```javascript\r\nUser.findAll({ \r\n    include: [{\r\n        model: Project,\r\n        through: {\r\n            where: {started: true}\r\n        }\r\n    }]\r\n}).then(...);\r\n```\r\n\r\nTo http://docs.sequelizejs.com/en/latest/api/associations/#belongstomanytarget-options\r\n\r\nThis would probably be enough to hint most users about the use of through but you might want to document its full API"}}