Last active
July 12, 2019 16:40
-
-
Save oreoluwade/3622d6e9f466eb0b8630bcc83a390d8e to your computer and use it in GitHub Desktop.
Mongoose schema for users
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 UserSchema = new mongoose.Schema({ | |
email: { | |
type: String, | |
required: true, | |
unique: true | |
}, | |
firstname: { | |
type: String | |
}, | |
lastname: { | |
type: String | |
}, | |
password: { | |
type: String, | |
required: true | |
}, | |
avatar: { | |
type: String | |
}, | |
galleryPhoto: { | |
type: String | |
} | |
}); | |
const Users = mongoose.model('user', UserSchema); | |
module.exports = Users; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment