-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
function authUser() {};
authUser.prototype.save = function(data) {
return new authUserModel(data).save();
};
authUser.prototype.update = function(data) {
let condition = {
login: data.login
};
return authUserModel.update(condition, data).exec();
};
authUser.prototype.find = function(condition) {
return authUserModel.find(condition).exec();
};
module.exports = new authUser();用class写舒服多了
class authUser {
save(data) {
return new authUserModel(data).save();
}
update(data) {
return authUserModel.update({
login: data.login
}, data).exec();
}
find(condition) {
return authUserModel.find(condition).exec();
}
}
module.exports = new authUser();Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels