Skip to content

Instantly share code, notes, and snippets.

@rtvsk
Created December 14, 2018 23:47
Show Gist options
  • Save rtvsk/bb97e32dfa67b0c03db79a7d6a38bac5 to your computer and use it in GitHub Desktop.
Save rtvsk/bb97e32dfa67b0c03db79a7d6a38bac5 to your computer and use it in GitHub Desktop.
models/User.js // auth
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