Created
November 2, 2018 21:04
-
-
Save maisonm/2de0264986d6a35ca15c5ec9415b38c6 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 User = require('./user'); | |
const CustomerSchema = new mongoose.Schema({ | |
user: { | |
type: mongoose.Schema.Types.ObjectId, | |
ref: 'User', | |
}, | |
name: { | |
type: String, | |
default: '', | |
}, | |
contact: { | |
type: String, | |
default: 'No contact name found', | |
}, | |
email: { | |
type: String, | |
default: 'No email addresses found', | |
}, | |
}); | |
module.exports = mongoose.model('Customer', CustomerSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment