31 lines
587 B
JavaScript
31 lines
587 B
JavaScript
const mongoose = require('mongoose') ;
|
|
|
|
const Schema = mongoose.Schema ;
|
|
|
|
const userSchema = new Schema({
|
|
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'
|
|
}
|
|
//need to add isAdmin
|
|
}) ;
|
|
|
|
module.exports = mongoose.model("User" , userSchema) ; |