Skip to content

Instantly share code, notes, and snippets.

@maisonm
Created November 2, 2018 21:04
Show Gist options
  • Save maisonm/2de0264986d6a35ca15c5ec9415b38c6 to your computer and use it in GitHub Desktop.
Save maisonm/2de0264986d6a35ca15c5ec9415b38c6 to your computer and use it in GitHub Desktop.
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