This repository has been archived on 2022-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
brainlet/models/User.js
2020-10-05 20:36:03 +03:00

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;