Created
June 6, 2018 15:35
-
-
Save danielkhan/bdb45d0ed35969a9ed2329fdbabe9cbc 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'); | |
const ContactSchema = mongoose.Schema({ | |
user_id: { | |
type: mongoose.Schema.ObjectId, | |
required: true, | |
}, | |
firstname: { | |
type: String, | |
required: true, | |
lowercase: true, | |
trim: true, | |
}, | |
lastname: { | |
type: String, | |
required: true, | |
lowercase: true, | |
trim: true, | |
}, | |
street: { | |
type: String, | |
required: true, | |
lowercase: true, | |
trim: true, | |
}, | |
zip: { | |
type: String, | |
required: true, | |
lowercase: true, | |
trim: true, | |
}, | |
city: { | |
type: String, | |
required: true, | |
lowercase: true, | |
trim: true, | |
}, | |
email: { | |
type: String, | |
required: true, | |
lowercase: true, | |
trim: true, | |
}, | |
}, { timestamps: true }); | |
module.exports = mongoose.model('Contact', ContactSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment