{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/mongoose/issues/3287","labels_url":"https://api.github.com/repos/Automattic/mongoose/issues/3287/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/mongoose/issues/3287/comments","events_url":"https://api.github.com/repos/Automattic/mongoose/issues/3287/events","html_url":"https://github.com/Automattic/mongoose/issues/3287","id":101990459,"number":3287,"title":"No way to validate that a property of a nested document is present when that nested document exists?","user":{"login":"adamzerner","id":3144254,"avatar_url":"https://avatars.githubusercontent.com/u/3144254?v=3","gravatar_id":"","url":"https://api.github.com/users/adamzerner","html_url":"https://github.com/adamzerner","followers_url":"https://api.github.com/users/adamzerner/followers","following_url":"https://api.github.com/users/adamzerner/following{/other_user}","gists_url":"https://api.github.com/users/adamzerner/gists{/gist_id}","starred_url":"https://api.github.com/users/adamzerner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamzerner/subscriptions","organizations_url":"https://api.github.com/users/adamzerner/orgs","repos_url":"https://api.github.com/users/adamzerner/repos","events_url":"https://api.github.com/users/adamzerner/events{/privacy}","received_events_url":"https://api.github.com/users/adamzerner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-19T20:25:17Z","updated_at":"2015-08-24T17:46:05Z","closed_at":null,"body":"http://stackoverflow.com/questions/32086455/how-do-you-validate-that-a-property-of-a-nested-document-is-present-when-that-ne"},"comment":{"url":"https://api.github.com/repos/Automattic/mongoose/issues/comments/134314252","html_url":"https://github.com/Automattic/mongoose/issues/3287#issuecomment-134314252","issue_url":"https://api.github.com/repos/Automattic/mongoose/issues/3287","id":134314252,"user":{"login":"vkarpov15","id":1620265,"avatar_url":"https://avatars.githubusercontent.com/u/1620265?v=3","gravatar_id":"","url":"https://api.github.com/users/vkarpov15","html_url":"https://github.com/vkarpov15","followers_url":"https://api.github.com/users/vkarpov15/followers","following_url":"https://api.github.com/users/vkarpov15/following{/other_user}","gists_url":"https://api.github.com/users/vkarpov15/gists{/gist_id}","starred_url":"https://api.github.com/users/vkarpov15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkarpov15/subscriptions","organizations_url":"https://api.github.com/users/vkarpov15/orgs","repos_url":"https://api.github.com/users/vkarpov15/repos","events_url":"https://api.github.com/users/vkarpov15/events{/privacy}","received_events_url":"https://api.github.com/users/vkarpov15/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T17:46:05Z","updated_at":"2015-08-24T17:46:05Z","body":"As suggested in SO, a pre validate hook is the way to go here."}}