email.model.js 711 B

1234567891011121314151617181920212223242526272829303132333435
  1. const mongoose = require('mongoose');
  2. const EmailSchema = new mongoose.Schema(
  3. {
  4. title: {
  5. type: String,
  6. required: true,
  7. minlength: 2
  8. },
  9. description: {
  10. type: String,
  11. required: true,
  12. minlength: 2
  13. },
  14. created_date: {
  15. type: Date,
  16. default: Date.now,
  17. required: true
  18. },
  19. text: {
  20. type: String,
  21. required: true
  22. },
  23. subject: {
  24. type: String,
  25. required: true,
  26. }
  27. }
  28. );
  29. exports.EmailSchema = EmailSchema;
  30. Email = mongoose.model('Email', EmailSchema );
  31. exports.Email = Email;