{"action":"closed","issue":{"url":"https://api.github.com/repos/strongloop/loopback/issues/1766","labels_url":"https://api.github.com/repos/strongloop/loopback/issues/1766/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback/issues/1766/comments","events_url":"https://api.github.com/repos/strongloop/loopback/issues/1766/events","html_url":"https://github.com/strongloop/loopback/issues/1766","id":112998013,"number":1766,"title":"Include Filter doesn't work for referencesMany relation","user":{"login":"mackwan84","id":4495151,"avatar_url":"https://avatars.githubusercontent.com/u/4495151?v=3","gravatar_id":"","url":"https://api.github.com/users/mackwan84","html_url":"https://github.com/mackwan84","followers_url":"https://api.github.com/users/mackwan84/followers","following_url":"https://api.github.com/users/mackwan84/following{/other_user}","gists_url":"https://api.github.com/users/mackwan84/gists{/gist_id}","starred_url":"https://api.github.com/users/mackwan84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mackwan84/subscriptions","organizations_url":"https://api.github.com/users/mackwan84/orgs","repos_url":"https://api.github.com/users/mackwan84/repos","events_url":"https://api.github.com/users/mackwan84/events{/privacy}","received_events_url":"https://api.github.com/users/mackwan84/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/strongloop/loopback/labels/question","name":"question","color":"cc317c"},{"url":"https://api.github.com/repos/strongloop/loopback/labels/triage","name":"triage","color":"eb6420"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-23T10:57:38Z","updated_at":"2015-10-27T00:46:29Z","closed_at":"2015-10-27T00:46:28Z","body":"I am working on a ticketing system with loopback recently. I have defined a ticket model with a relation named \"assignees\" which reference to the model \"EndUser\" using referencesMany. However, when I try to list out all tickets with Include Filter, no assignees are returned from the query. Why?\r\n\r\nHere is my model definition\r\n\r\n```\r\n{\r\n  \"name\": \"Ticket\",\r\n  \"base\": \"PersistedModel\",\r\n  \"idInjection\": true,\r\n  \"options\": {\r\n    \"validateUpsert\": true\r\n  },\r\n  \"properties\": {\r\n    \"title\": {\r\n      \"type\": \"string\",\r\n      \"required\": true\r\n    },\r\n    \"description\": {\r\n      \"type\": \"string\",\r\n      \"required\": true\r\n    },\r\n    \"status\": {\r\n      \"type\": \"string\",\r\n      \"default\": \"open\"\r\n    },\r\n    \"priority\": {\r\n      \"type\": \"number\",\r\n      \"default\": 1\r\n    },\r\n    \"source\": {\r\n      \"type\": \"string\"\r\n    },\r\n    \"tags\": {\r\n      \"type\": [\r\n        \"string\"\r\n      ]\r\n    },\r\n    \"created\": {\r\n      \"type\": \"date\",\r\n      \"defaultFn\": \"now\"\r\n    },\r\n    \"modified\": {\r\n      \"type\": \"date\",\r\n      \"defaultFn\": \"now\"\r\n    },\r\n    \"due\": {\r\n      \"type\": \"date\"\r\n    }\r\n  },\r\n  \"validations\": [],\r\n  \"relations\": {\r\n    \"requester\": {\r\n      \"type\": \"belongsTo\",\r\n      \"model\": \"EndUser\",\r\n      \"foreignKey\": \"requesterId\"\r\n    },\r\n    \"assignees\": {\r\n      \"type\": \"referencesMany\",\r\n      \"model\": \"EndUser\",\r\n      \"property\": \"assigneeIds\",\r\n      \"options\": {\r\n        \"validate\": true,\r\n        \"forceId\": true\r\n      }\r\n    }\r\n  },\r\n  \"acls\": [],\r\n  \"methods\": {}\r\n}\r\n```"}}