{"action":"closed","issue":{"url":"https://api.github.com/repos/Automattic/mongoose/issues/6293","repository_url":"https://api.github.com/repos/Automattic/mongoose","labels_url":"https://api.github.com/repos/Automattic/mongoose/issues/6293/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/mongoose/issues/6293/comments","events_url":"https://api.github.com/repos/Automattic/mongoose/issues/6293/events","html_url":"https://github.com/Automattic/mongoose/issues/6293","id":309958188,"number":6293,"title":"Mongoose populate query on populate field and filter the result that have null","user":{"login":"pratraj","id":11705189,"avatar_url":"https://avatars2.githubusercontent.com/u/11705189?v=4","gravatar_id":"","url":"https://api.github.com/users/pratraj","html_url":"https://github.com/pratraj","followers_url":"https://api.github.com/users/pratraj/followers","following_url":"https://api.github.com/users/pratraj/following{/other_user}","gists_url":"https://api.github.com/users/pratraj/gists{/gist_id}","starred_url":"https://api.github.com/users/pratraj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pratraj/subscriptions","organizations_url":"https://api.github.com/users/pratraj/orgs","repos_url":"https://api.github.com/users/pratraj/repos","events_url":"https://api.github.com/users/pratraj/events{/privacy}","received_events_url":"https://api.github.com/users/pratraj/received_events","type":"User","site_admin":false},"labels":[{"id":335758689,"url":"https://api.github.com/repos/Automattic/mongoose/labels/needs%20clarification","name":"needs clarification","color":"EB219B","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-30T02:27:04Z","updated_at":"2018-04-05T18:27:21Z","closed_at":"2018-04-05T18:27:21Z","author_association":"NONE","body":"I have users collection that has data and their post referenced id.\r\n\r\n```javascript\r\nusers:[\r\n    {\r\n        _id:\"bxhhsjjsj09923445325\",\r\n        name:\"My Name\",\r\n        myPosts:[\"ppan232342423\",\"iweiej004994\"]\r\n\r\n    }\r\n]\r\nand the posts collection data is below.\r\n\r\nposts:[\r\n    {\r\n        _id:\"ppan232342423\",\r\n        data:\"Hello Hi\",\r\n        isDeleted:false\r\n    }\r\n    {\r\n        _id:\"iweiej004994\",\r\n        data:\"Bye Bye\",\r\n        isDeleted:true\r\n    }\r\n]\r\n```\r\nI am writing a query on Users Scheme and filter the post that is Deleted. I want to filter the User data that post returns null.\r\n\r\n```javascript\r\nusers.find().populate({\r\n        path: 'myPosts',\r\n        model: 'posts',\r\n        match: {isDeleted:true},\r\n    })\r\n```"}}
{"actor":{"display_login":"varunjayaraman"}}