Skip to content

Instantly share code, notes, and snippets.

@artemis15
Created October 7, 2019 18:15
Show Gist options
  • Save artemis15/09cc6092a589e1cf1ebbb45e743d0080 to your computer and use it in GitHub Desktop.
Save artemis15/09cc6092a589e1cf1ebbb45e743d0080 to your computer and use it in GitHub Desktop.
Model for user schema JWT
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