All files / Zapcard_API/models description.js

100% Statements 3/3
100% Branches 0/0
100% Functions 0/0
100% Lines 3/3
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      1x       1x                               1x  
/**
* Module Dependencies
*/
const mongoose = require('mongoose');
/**
* Define the Database structure for Description (Schema)
*/
const DescriptionSchema = new mongoose.Schema({
  description: {
    type: String,
    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('Description', DescriptionSchema);