You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
555 B

  1. var mongoose = require('mongoose'),
  2. Schema = mongoose.Schema;
  3. var mongooseUniqueValidator = require('mongoose-unique-validator');
  4. var adminSchema = new Schema({
  5. username: { type: String, required: true, unique: true },
  6. password: { type: String, required: true, select: false },
  7. email: { type: String, required: true },
  8. phone: { type: String },
  9. telegram: { type: String },
  10. token: { type: String, select: false }
  11. })
  12. adminSchema.plugin(mongooseUniqueValidator);
  13. module.exports = mongoose.model('adminModel', adminSchema);