{"action":"created","issue":{"url":"https://api.github.com/repos/joegoldbeck/mongoose-encryption/issues/41","repository_url":"https://api.github.com/repos/joegoldbeck/mongoose-encryption","labels_url":"https://api.github.com/repos/joegoldbeck/mongoose-encryption/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/joegoldbeck/mongoose-encryption/issues/41/comments","events_url":"https://api.github.com/repos/joegoldbeck/mongoose-encryption/issues/41/events","html_url":"https://github.com/joegoldbeck/mongoose-encryption/issues/41","id":178206529,"number":41,"title":"Support discriminators","user":{"login":"mattdawson","id":7719905,"avatar_url":"https://avatars.githubusercontent.com/u/7719905?v=3","gravatar_id":"","url":"https://api.github.com/users/mattdawson","html_url":"https://github.com/mattdawson","followers_url":"https://api.github.com/users/mattdawson/followers","following_url":"https://api.github.com/users/mattdawson/following{/other_user}","gists_url":"https://api.github.com/users/mattdawson/gists{/gist_id}","starred_url":"https://api.github.com/users/mattdawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattdawson/subscriptions","organizations_url":"https://api.github.com/users/mattdawson/orgs","repos_url":"https://api.github.com/users/mattdawson/repos","events_url":"https://api.github.com/users/mattdawson/events{/privacy}","received_events_url":"https://api.github.com/users/mattdawson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-20T23:26:05Z","updated_at":"2016-09-22T13:55:38Z","closed_at":null,"body":"If I have a schema 'Parent' with a child schema 'Child' where parent has an encrypted field,\r\nwhen saving child, the encrypted parent field is not encrypted.\r\nI can fix this by placing the encrypt for the parent field on all the child types.\r\nBut, if I also place an encrypt on the child type at the same time as the parent type the pre-save method clears the field as it as called twice, once for each type in the hierachy.  The first call encrypts and removes the fields the second call finds the fields empty and erases them."},"comment":{"url":"https://api.github.com/repos/joegoldbeck/mongoose-encryption/issues/comments/248910333","html_url":"https://github.com/joegoldbeck/mongoose-encryption/issues/41#issuecomment-248910333","issue_url":"https://api.github.com/repos/joegoldbeck/mongoose-encryption/issues/41","id":248910333,"user":{"login":"joegoldbeck","id":2604712,"avatar_url":"https://avatars.githubusercontent.com/u/2604712?v=3","gravatar_id":"","url":"https://api.github.com/users/joegoldbeck","html_url":"https://github.com/joegoldbeck","followers_url":"https://api.github.com/users/joegoldbeck/followers","following_url":"https://api.github.com/users/joegoldbeck/following{/other_user}","gists_url":"https://api.github.com/users/joegoldbeck/gists{/gist_id}","starred_url":"https://api.github.com/users/joegoldbeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joegoldbeck/subscriptions","organizations_url":"https://api.github.com/users/joegoldbeck/orgs","repos_url":"https://api.github.com/users/joegoldbeck/repos","events_url":"https://api.github.com/users/joegoldbeck/events{/privacy}","received_events_url":"https://api.github.com/users/joegoldbeck/received_events","type":"User","site_admin":false},"created_at":"2016-09-22T13:55:38Z","updated_at":"2016-09-22T13:55:38Z","body":"Thanks @mattdawson for filing the issue. I'm not sure I fully understand. Can you post a code snippet that demonstrates the behavior? Which version of Mongoose are you using? Thanks!"}}
{"actor":{"display_login":"joegoldbeck"}}