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.
 
 
 
 

28 lines
755 B

var mongoose = require('mongoose'),
Schema = mongoose.Schema;
var mongooseUniqueValidator = require('mongoose-unique-validator');
var userSchema = new Schema({
username: { type: String, unique: true },
password: { type: String },
description: { type: String },
avatar: { type: String },
mail: { type: String },
phone: { type: String },
telegram: { type: String },
valorations: [{
username: { type: String },
value: { type: Number },
comment: { type: String }
}],
favs: [{
username: { type: String },
userId: { type: String },
avatar: { type: String }
}]
})
userSchema.plugin(mongooseUniqueValidator);
module.exports = mongoose.model('userModel', userSchema);