sbuhacks/auth/models/user-model.js
2022-09-24 17:06:11 -04:00

15 lines
440 B
JavaScript

const mongoose = require('mongoose')
const Schema = mongoose.Schema
const ObjectId = Schema.Types.ObjectId
const UserSchema = new Schema(
{
name: { type: String, required: true },
passwordHash: { type: String, required: true },
email: { type: String, required: true },
favorites: { type: [ObjectId], reqired: true }
},
{ timestamps: true }
)
module.exports = mongoose.model('User', UserSchema);