Last active
November 20, 2019 08:28
-
-
Save FermiDirak/178393cc889d8d437a206e3245a6b822 to your computer and use it in GitHub Desktop.
This file contains hidden or 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; | |
const userSchema = new Schema({ | |
username: { | |
type: String, | |
index: true, | |
unique: true, | |
dropDups: true, | |
required: true, | |
}, | |
passwordHash: { //salted and hashed using bcrypt | |
type: String, | |
required: true, | |
}, | |
}); | |
const User = mongoose.model('User', userSchema); | |
module.exports = User; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment