Cantilever-Labs/models/User.js

40 lines
731 B
JavaScript
Raw Normal View History

2021-03-26 06:29:27 -07:00
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 : {
2021-04-01 06:38:27 -07:00
type : String
} ,
googleId : {
type : String
} ,
student : {
type : mongoose.Types.ObjectId ,
ref: 'Student'
2021-04-12 05:44:50 -07:00
} ,
isAdmin : {
type : Boolean
} ,
numLoggedIn : {
type : Number
} ,
clicked : {
type : Object
2021-03-26 06:29:27 -07:00
}
//need to add isAdmin
2021-03-26 06:29:27 -07:00
}) ;
module.exports = mongoose.model("User" , userSchema) ;