/**
* Module Dependencies
*/
const mongoose = require('mongoose');
/**
* Define the Database structure for Card (Schema)
*/
const CardSchema = new mongoose.Schema({
name: {
type: String,
required: true,
trim: true,
},
description: {
type: mongoose.Schema.Types.ObjectId,
ref: 'Description',
},
email: {
type: mongoose.Schema.Types.ObjectId,
ref: 'Email',
},
telephone: {
type: mongoose.Schema.Types.ObjectId,
ref: 'Telephone',
},
createdBy: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User',
required: true,
},
});
/**
* Make the Schema available in the app
*/
module.exports = mongoose.model('Card', CardSchema);
|