Created
November 24, 2019 14:28
-
-
Save abbasogaji/bc0177beb9df0ece135b079947d42706 to your computer and use it in GitHub Desktop.
user moogose schema
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
// | |
// ──────────────────────────────────────────────────────────────────────────── I ────────── | |
// :::::: U S E R M O N G O D B M O D E L : : : : : : : : | |
// ────────────────────────────────────────────────────────────────────────────────────── | |
/******************************************************************************************** | |
* | |
* Information for stored in the document include; | |
* Name, | |
* Email, | |
* Password | |
* | |
*********************************************************************************************/ | |
// | |
// ─── IMPORTS ──────────────────────────────────────────────────────────────────── | |
// | |
const mongoose = | |
require("mongoose") | |
// | |
// ─── BODY ─────────────────────────────────────────────────────────────────────── | |
// | |
const userSchema = | |
new mongoose.Schema ({ | |
name : { | |
type : String, | |
required: true | |
}, | |
email : { | |
type: String, | |
unique: true, | |
required: true | |
}, | |
password : { | |
type: String, | |
required: true | |
}, | |
emailVerification : { | |
isVerified : { type : Boolean, default : false}, | |
code : String, | |
expiryDate : String | |
}, | |
verified : { | |
type : Boolean, | |
required : true | |
} | |
}, | |
{ | |
timestamps : true | |
}) | |
// | |
// ─── EXPORTS ──────────────────────────────────────────────────────────────────── | |
// | |
module.exports = mongoose.model('User', userSchema) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment