forked from hippoz/brainlet
14 lines
303 B
JavaScript
14 lines
303 B
JavaScript
|
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;
|