| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 1x 1x 1x 1x | /**
* Module Dependencies
*/
const mongoose = require('mongoose');
require('mongoose-type-email');
/**
* Define the Database structure for Email (Schema)
*/
const EmailSchema = new mongoose.Schema({
email: {
type: mongoose.SchemaTypes.Email,
required: true,
trim: true,
},
createdBy: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User',
required: true,
},
});
/**
* Make the Schema available in the app
*/
module.exports = mongoose.model('Email', EmailSchema);
|