User.js 421 B

12345678910111213
  1. const {model, Schema} = require('mongoose');
  2. const User = new Schema({
  3. userName: {type: String, unique: true, required: true},
  4. hashPassword: {type: String, required: true},
  5. isAdmin: {type: Boolean, default: false},
  6. isBanned: {type: Boolean, default: false},
  7. isMutted: {type: Boolean, default: false},
  8. avatar: {type: String, unique: true, required: false}
  9. })
  10. module.exports = model('User', User)