Created
November 2, 2018 20:59
-
-
Save maisonm/58a71c22e2d33754bed9b0c9d3b1ee37 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'); | |
// *** NOTE: You never want to store a plain password in production! If someone gains access to your database, they will have access to all the users passwords. | |
// You can use something like PassportJS to handle saving passwords | |
const UserSchema = new mongoose.Schema({ | |
username: { | |
type: String, | |
default: '', | |
}, | |
password: { | |
type: String, | |
default: '', | |
}, | |
email: { | |
type: String, | |
default: 'N/A', | |
}, | |
registerDate: { | |
type: Date, | |
default: Date.now(), | |
}, | |
}); | |
module.exports = mongoose.model('User', UserSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment