Created
December 14, 2018 23:47
-
-
Save rtvsk/bb97e32dfa67b0c03db79a7d6a38bac5 to your computer and use it in GitHub Desktop.
models/User.js // auth
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; | |
const UserSchema = new Schema({ | |
name: { | |
type: String, | |
required: true | |
}, | |
email: { | |
type: String, | |
required: true | |
}, | |
password: { | |
type: String, | |
required: true | |
}, | |
data: { | |
type: Date, | |
default: Date.now() | |
} | |
}); | |
module.exports = User = mongoose.model('users', UserSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment