CSE316/hw4/server/models/user-model.js

16 lines
442 B
JavaScript
Raw Permalink Normal View History

2022-05-23 06:22:34 -04:00
const mongoose = require('mongoose')
const Schema = mongoose.Schema
const ObjectId = Schema.Types.ObjectId
const UserSchema = new Schema(
{
firstName: { type: String, required: true },
lastName: { type: String, required: true },
email: { type: String, required: true },
passwordHash: { type: String, required: true }
},
{ timestamps: true },
)
module.exports = mongoose.model('User', UserSchema)