lecture.js 712 B

12345678910111213141516171819202122232425262728293031323334353637
  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. url: String,
  30. date: {
  31. type: Date,
  32. default: new Date()
  33. }
  34. });
  35. module.exports = mongoose.model("Lecture", LectureSchema);