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.
 
 
 
 

36 lines
997 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 },
token: { 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 }
}],
notifications: [{
type: { type: String },//fav, comment, join
otherusername: { type: String },
description: { type: String },
date: { type: Date },
link: { type: String }
}]
})
userSchema.plugin(mongooseUniqueValidator);
module.exports = mongoose.model('userModel', userSchema);