Cantilever-Labs/models/User.js

38 lines
571 B
JavaScript
Raw Normal View History

2021-05-09 04:31:53 -07:00
const mongoose = require("mongoose");
2021-03-26 06:29:27 -07:00
2021-05-09 04:31:53 -07:00
const Schema = mongoose.Schema;
2021-03-26 06:29:27 -07:00
const userSchema = new Schema({
2021-05-09 04:31:53 -07:00
firstName: {
type: String,
required: true,
},
lastName: {
type: String,
required: true,
},
email: {
type: String,
required: true,
},
password: {
type: String,
},
googleId: {
type: String,
},
student: {
type: mongoose.Types.ObjectId,
ref: "Student",
},
isAdmin: {
type: Boolean,
},
otp: {
type: String,
},
//need to add isAdmin
});
2021-03-26 06:29:27 -07:00
2021-05-09 04:31:53 -07:00
module.exports = mongoose.model("User", userSchema);