lecture.js 796 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. const mongoose = require("mongoose");
  2. const LectureSchema = new mongoose.Schema({
  3. course: {
  4. type: mongoose.Schema.Types.ObjectId,
  5. ref: "Course",
  6. required: true
  7. },
  8. title: {
  9. type: String,
  10. required: true
  11. },
  12. video: {
  13. type: String,
  14. required: true
  15. },
  16. description: {
  17. type: String,
  18. required: true,
  19. },
  20. furtherReading: [{
  21. text: String,
  22. link: String
  23. }],
  24. documents: [{
  25. name: String,
  26. link: String
  27. }],
  28. exercises: [String],
  29. createdDate: {
  30. type: Date,
  31. default: new Date(),
  32. required: true
  33. },
  34. updatedDate: {
  35. type: Date,
  36. required: false
  37. }
  38. });
  39. module.exports = mongoose.model("Lecture", LectureSchema);