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.

23 lines
637 B

  1. var mongoose = require('mongoose'),
  2. Schema = mongoose.Schema;
  3. var mongooseUniqueValidator = require('mongoose-unique-validator');
  4. var userSchema = new Schema({
  5. username: { type: String, unique: true },
  6. password: { type: String },
  7. description: { type: String },
  8. avatar: { type: String },
  9. mail: { type: String },
  10. phone: { type: String },
  11. telegram: { type: String },
  12. valorations: [{
  13. username: { type: String },
  14. value: { type: Number },
  15. comment: { type: String }
  16. }]
  17. })
  18. userSchema.plugin(mongooseUniqueValidator);
  19. module.exports = mongoose.model('userModel', userSchema);