{"size": 410, "ext": "js", "max_stars_repo_path": "controller/edit/client.edit.email.controller.js", "max_stars_repo_name": "Zebiano/mPark", "max_stars_repo_stars_event_min_datetime": "2019-01-22T19:52:56.000Z", "max_stars_repo_stars_event_max_datetime": "2019-01-22T19:52:56.000Z", "max_issues_repo_path": "controller/edit/client.edit.email.controller.js", "max_issues_repo_name": "Zebiano/mPark", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "controller/edit/client.edit.email.controller.js", "max_forks_repo_name": "Zebiano/mPark", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.1176470588, "max_line_length": 120, "alphanum_fraction": 0.5804878049}
// Change emnail
function changeEmail(req, res) {
    global.userSchema.mgUser.findByIdAndUpdate(req.session.user._id, { email: req.body.newEmail }, function(err, user) {
        if (err) {
            console.log(err);
        }
        else {
            res.end('{"success" : "Updated Successfully", "status" : 200}');
        }
    });

}
// Export Module
module.exports = {
    changeEmail: changeEmail
}
