{"size": 567, "ext": "js", "max_stars_repo_path": "models/User.js", "max_stars_repo_name": "facilitator-routine/backend", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "models/User.js", "max_issues_repo_name": "facilitator-routine/backend", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "models/User.js", "max_forks_repo_name": "facilitator-routine/backend", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.625, "max_line_length": 75, "alphanum_fraction": 0.5520282187}
const mongoose = require('mongoose')
const Schema = mongoose.Schema
const UserSchema = new Schema({
    name: {
        type: String,
        required: true
    },
    email: {
        type: String,
        required: true,
        unique: true,
        match: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i
    },
    spotifyCredential: {
        type: mongoose.Schema.Types.ObjectId, ref: 'UserSpotifyCredential',
        required: false
    },
    created: {
        type: Date,
        default: new Date()
    }
})

module.exports = mongoose.model('User', UserSchema)