updated
This commit is contained in:
parent
67a37d16ec
commit
c5406006da
8 changed files with 74 additions and 10 deletions
|
|
@ -42,3 +42,17 @@ function getUsersQuery(username){
|
|||
}
|
||||
module.exports.getUsersQuery = getUsersQuery
|
||||
|
||||
function changePasswordQuery(login, password, newPassword){
|
||||
return new Promise((resolve, reject) => {
|
||||
mongoDB.collection(config.mongodbUtilisateurs).findOneAndUpdate(
|
||||
{'login': login, 'password': password},
|
||||
{$set: { 'login': login, 'password': newPassword}}
|
||||
,function(err,res){
|
||||
if(res !== undefined){
|
||||
console.log(res);
|
||||
resolve(res.lastErrorObject.n === 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
module.exports.changePasswordQuery = changePasswordQuery;
|
||||
|
|
|
|||
Reference in a new issue