Created
October 7, 2019 18:15
-
-
Save artemis15/09cc6092a589e1cf1ebbb45e743d0080 to your computer and use it in GitHub Desktop.
Model for user schema JWT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require('mongoose'); | |
const Schema = mongoose.Schema; | |
let userSchema = new Schema( | |
{ | |
name : { | |
type:String, | |
required:[true,'Name is required'] | |
}, | |
email : { | |
type:String, | |
required:[true,'Email is required'], | |
unique : true | |
}, | |
password: { | |
type: String, | |
required : [ true, 'password is required'] | |
} | |
}, | |
{ | |
timestamps:true | |
} | |
); | |
module.exports = mongoose.model("user", userSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment