{"action":"opened","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/3008","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/3008/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/3008/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/3008/events","html_url":"https://github.com/sequelize/sequelize/issues/3008","id":55514668,"number":3008,"title":"Eager loading with where clause returns null when nothing is found","user":{"login":"MtDalPizzol","id":3843774,"avatar_url":"https://avatars.githubusercontent.com/u/3843774?v=3","gravatar_id":"","url":"https://api.github.com/users/MtDalPizzol","html_url":"https://github.com/MtDalPizzol","followers_url":"https://api.github.com/users/MtDalPizzol/followers","following_url":"https://api.github.com/users/MtDalPizzol/following{/other_user}","gists_url":"https://api.github.com/users/MtDalPizzol/gists{/gist_id}","starred_url":"https://api.github.com/users/MtDalPizzol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MtDalPizzol/subscriptions","organizations_url":"https://api.github.com/users/MtDalPizzol/orgs","repos_url":"https://api.github.com/users/MtDalPizzol/repos","events_url":"https://api.github.com/users/MtDalPizzol/events{/privacy}","received_events_url":"https://api.github.com/users/MtDalPizzol/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-26T17:54:34Z","updated_at":"2015-01-26T17:54:34Z","closed_at":null,"body":"In my app, a user can have more than one email address, but only one of those is set as the main email. When I try to get the user including only the email which are not the main email and the user has only the main email registered in the database, I was expecting to get the user data and no emails at all. Instead, I'm getting no data at all.\r\n\r\nUser.find({\r\n     where: {\r\n          id: req.params.userId\r\n     },\r\n     include: [{\r\n          model: Email,\r\n          where: {\r\n               main: false\r\n          }\r\n     }]\r\n}).then(function(user) {\r\n     console.log(user); // null\r\n});"}}