Bcrypt.hash(request.body.password, 10, (error, hash) => {
console.log(hash)
studentSchema
.findOneAndUpdate(
{ userName: request.body.username },
{
$set: {
password:hash
}
}
)
.then(data => {
response.send(data);
})
.catch(error => {
alert(error)
});
})