Skip to content

Instantly share code, notes, and snippets.

@oreoluwade
Last active July 12, 2019 16:40
Show Gist options
  • Save oreoluwade/3622d6e9f466eb0b8630bcc83a390d8e to your computer and use it in GitHub Desktop.
Save oreoluwade/3622d6e9f466eb0b8630bcc83a390d8e to your computer and use it in GitHub Desktop.
Mongoose schema for users
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