{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/mongoose/issues/2462","labels_url":"https://api.github.com/repos/Automattic/mongoose/issues/2462/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/mongoose/issues/2462/comments","events_url":"https://api.github.com/repos/Automattic/mongoose/issues/2462/events","html_url":"https://github.com/Automattic/mongoose/issues/2462","id":48628032,"number":2462,"title":"Pre save runs before pre validate in 4.0","user":{"login":"optikfluffel","id":379915,"avatar_url":"https://avatars.githubusercontent.com/u/379915?v=3","gravatar_id":"","url":"https://api.github.com/users/optikfluffel","html_url":"https://github.com/optikfluffel","followers_url":"https://api.github.com/users/optikfluffel/followers","following_url":"https://api.github.com/users/optikfluffel/following{/other_user}","gists_url":"https://api.github.com/users/optikfluffel/gists{/gist_id}","starred_url":"https://api.github.com/users/optikfluffel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/optikfluffel/subscriptions","organizations_url":"https://api.github.com/users/optikfluffel/orgs","repos_url":"https://api.github.com/users/optikfluffel/repos","events_url":"https://api.github.com/users/optikfluffel/events{/privacy}","received_events_url":"https://api.github.com/users/optikfluffel/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/Automattic/mongoose/milestones/30","html_url":"https://github.com/Automattic/mongoose/milestones/4.0.0-rc4","labels_url":"https://api.github.com/repos/Automattic/mongoose/milestones/30/labels","id":995895,"number":30,"title":"4.0.0-rc4","description":"","creator":{"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},"open_issues":0,"closed_issues":9,"state":"closed","created_at":"2015-02-25T21:07:14Z","updated_at":"2015-03-13T19:23:45Z","due_on":"2015-03-13T04:00:00Z","closed_at":"2015-03-13T19:23:45Z"},"comments":20,"created_at":"2014-11-13T11:56:25Z","updated_at":"2015-04-24T19:51:12Z","closed_at":"2015-03-12T14:46:28Z","body":"Hi, I found the `Model.create` method a few days ago and switched to it from doing\r\n\r\n```javascript\r\nx = new Foo({ bar: 'baz' });\r\nx.save(function (error) {...});\r\n```\r\n\r\nbut now my\r\n\r\n```javascript\r\nfooSchema.pre('save', function(next) {...});\r\n```\r\n\r\nisn't called anymore. Is that normal behaviour or a bug? I can't really tell, but I didn't find anything in the docs either.\r\n\r\nThanks in advance, optikfluffel"},"comment":{"url":"https://api.github.com/repos/Automattic/mongoose/issues/comments/96045429","html_url":"https://github.com/Automattic/mongoose/issues/2462#issuecomment-96045429","issue_url":"https://api.github.com/repos/Automattic/mongoose/issues/2462","id":96045429,"user":{"login":"buunguyen","id":406631,"avatar_url":"https://avatars.githubusercontent.com/u/406631?v=3","gravatar_id":"","url":"https://api.github.com/users/buunguyen","html_url":"https://github.com/buunguyen","followers_url":"https://api.github.com/users/buunguyen/followers","following_url":"https://api.github.com/users/buunguyen/following{/other_user}","gists_url":"https://api.github.com/users/buunguyen/gists{/gist_id}","starred_url":"https://api.github.com/users/buunguyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buunguyen/subscriptions","organizations_url":"https://api.github.com/users/buunguyen/orgs","repos_url":"https://api.github.com/users/buunguyen/repos","events_url":"https://api.github.com/users/buunguyen/events{/privacy}","received_events_url":"https://api.github.com/users/buunguyen/received_events","type":"User","site_admin":false},"created_at":"2015-04-24T19:51:12Z","updated_at":"2015-04-24T19:51:12Z","body":"Good point. I wasn't aware of the `validate()` method and I never have to use it. For all my use cases working with Mongoose so far, schema validation is the final safety check before data is actually persisted to MongoDB and I never explicit invoke it. I don't really know when it makes sense to explicitly call `validate()`, but I agree with you that if people do that, they'd expect the separation as you said."}}