framez-server/Server/Schemas/User.js

11 lines
389 B
JavaScript

const mongoose = require('mongoose');
const Config = require('../Config/Config')
const Schema = mongoose.Schema;
const User = new Schema({
account_id: {type: Schema.Types.ObjectId, ref: 'Account'},
nickname: { type: String, required: true, index: { unique: true } },
avatar: { type: String, default: Config.defaults.user.avatar }
});
module.exports = mongoose.model('User', User);