{"action":"created","issue":{"url":"https://api.github.com/repos/LearnBoost/mongoose/issues/2637","labels_url":"https://api.github.com/repos/LearnBoost/mongoose/issues/2637/labels{/name}","comments_url":"https://api.github.com/repos/LearnBoost/mongoose/issues/2637/comments","events_url":"https://api.github.com/repos/LearnBoost/mongoose/issues/2637/events","html_url":"https://github.com/LearnBoost/mongoose/issues/2637","id":56293855,"number":2637,"title":"feature request: Cast plain object to mongoose document","user":{"login":"DesignByOnyx","id":514040,"avatar_url":"https://avatars.githubusercontent.com/u/514040?v=3","gravatar_id":"","url":"https://api.github.com/users/DesignByOnyx","html_url":"https://github.com/DesignByOnyx","followers_url":"https://api.github.com/users/DesignByOnyx/followers","following_url":"https://api.github.com/users/DesignByOnyx/following{/other_user}","gists_url":"https://api.github.com/users/DesignByOnyx/gists{/gist_id}","starred_url":"https://api.github.com/users/DesignByOnyx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DesignByOnyx/subscriptions","organizations_url":"https://api.github.com/users/DesignByOnyx/orgs","repos_url":"https://api.github.com/users/DesignByOnyx/repos","events_url":"https://api.github.com/users/DesignByOnyx/events{/privacy}","received_events_url":"https://api.github.com/users/DesignByOnyx/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/LearnBoost/mongoose/labels/help","name":"help","color":"FFFFFF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-02-02T21:12:39Z","updated_at":"2015-02-04T18:14:16Z","closed_at":null,"body":"RE: http://stackoverflow.com/questions/24190478/cast-plain-object-to-mongoose-document\r\n\r\nWhen mongoose loads data from the database, it converts (casts) that data into instances of mongoose Document.  It would be nice if this functionality was exposed to the outside world, or if mongoose would provide some sort of best practices recommendation.  I am posting this request because other users on SO voted for it."},"comment":{"url":"https://api.github.com/repos/LearnBoost/mongoose/issues/comments/72907362","html_url":"https://github.com/LearnBoost/mongoose/issues/2637#issuecomment-72907362","issue_url":"https://api.github.com/repos/LearnBoost/mongoose/issues/2637","id":72907362,"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-02-04T18:14:16Z","updated_at":"2015-02-04T18:14:16Z","body":"Why don't you just use `new Person(req.body)`? Hydrate is mostly meant to take raw data from the database."}}