-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsection.js
More file actions
21 lines (19 loc) · 829 Bytes
/
section.js
File metadata and controls
21 lines (19 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const mongoose = require("mongoose");
const { Schema } = mongoose;
const { lecture, lectureSchema } = require("./lecture");
const { sectionQuizSchema } = require("./sectionQuiz");
const { sectionAssignmentSchema } = require("./sectionAssignment");
const sectionSchema = new Schema(
{
title: { type: String, required: true },
description: { type: String },
courseId: { type: Schema.Types.ObjectId, ref: "course", required: true },
lectures: [{ type: Schema.Types.ObjectId, ref: "lecture" }],
quizzes: [{ type: Schema.Types.ObjectId, ref: "sectionQuiz" }],
assignment: [{ type: Schema.Types.ObjectId, ref: "sectionAssignment" }],
sequence: [Schema.Types.ObjectId ]
},
{ timestamps: true }
);
const section = mongoose.model("section", sectionSchema);
module.exports = { section, sectionSchema };