14 lines
No EOL
303 B
JavaScript
Executable file
14 lines
No EOL
303 B
JavaScript
Executable file
const mongoose = require('mongoose');
|
|
|
|
const User = mongoose.model('User', {
|
|
username: String,
|
|
password: String,
|
|
email: String,
|
|
role: String
|
|
});
|
|
|
|
User.findByUsername = async function(username) {
|
|
return await User.findOne({ username }).exec();
|
|
};
|
|
|
|
module.exports = User; |