{"action":"closed","issue":{"url":"https://api.github.com/repos/strongloop/loopback/issues/1342","labels_url":"https://api.github.com/repos/strongloop/loopback/issues/1342/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback/issues/1342/comments","events_url":"https://api.github.com/repos/strongloop/loopback/issues/1342/events","html_url":"https://github.com/strongloop/loopback/issues/1342","id":71533693,"number":1342,"title":"Can't include role when I put it in Mongodb","user":{"login":"HelloCui","id":4626117,"avatar_url":"https://avatars.githubusercontent.com/u/4626117?v=3","gravatar_id":"","url":"https://api.github.com/users/HelloCui","html_url":"https://github.com/HelloCui","followers_url":"https://api.github.com/users/HelloCui/followers","following_url":"https://api.github.com/users/HelloCui/following{/other_user}","gists_url":"https://api.github.com/users/HelloCui/gists{/gist_id}","starred_url":"https://api.github.com/users/HelloCui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HelloCui/subscriptions","organizations_url":"https://api.github.com/users/HelloCui/orgs","repos_url":"https://api.github.com/users/HelloCui/repos","events_url":"https://api.github.com/users/HelloCui/events{/privacy}","received_events_url":"https://api.github.com/users/HelloCui/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/strongloop/loopback/labels/triage","name":"triage","color":"eb6420"},{"url":"https://api.github.com/repos/strongloop/loopback/labels/waiting","name":"waiting","color":"F5ECCE"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-28T09:23:59Z","updated_at":"2015-07-07T20:06:53Z","closed_at":"2015-07-07T20:06:53Z","body":"my user model's relation is\r\n```javascript\r\n\"roles\": {\r\n      \"type\": \"hasMany\",\r\n      \"model\": \"Role\",\r\n      \"foreignKey\": \"principalId\",\r\n      \"through\": \"RoleMapping\"\r\n}\r\n```\r\nIn memory db, it work well:\r\n![1](https://cloud.githubusercontent.com/assets/4626117/7366470/10871112-edcb-11e4-89e0-913585ce559a.png)\r\nBut when I put the Role and RoleMapping to a mongodb, it get sick\r\n![2](https://cloud.githubusercontent.com/assets/4626117/7366474/165cc5aa-edcb-11e4-91c1-405da83c8898.png)\r\n\r\nWhat's wrong with that?\r\n"}}