-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudent.js
More file actions
34 lines (30 loc) · 979 Bytes
/
student.js
File metadata and controls
34 lines (30 loc) · 979 Bytes
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
26
27
28
29
30
31
32
33
34
const mongoose = require("mongoose");
const { Schema } = mongoose;
const {coursePurchaseSchema}=require('./coursePurchase');
const studentSchema = new Schema({
email: { type: String, required: true },
password: { type: String, required: true },
courses: [
{
couseId: { type: Schema.Types.ObjectId, ref: "course", index: true },
performance: Number,
isCompletedOnce: Boolean,
certificateIssued: Boolean,
certificatePath: String,
notes:[
{type:Schema.Types.ObjectId,ref:'studentNote'}
],
createdDate: { type: Date, default: Date.now },
},
],
purchases: [coursePurchaseSchema],
wishList: [
{
couseId: { type: Schema.Types.ObjectId, ref: "course", index: true },
createdDate: { type: Date, default: Date.now },
},
],
cart: [{ type: Schema.Types.ObjectId, ref: "course" }],
});
const student = mongoose.model("student", studentSchema);
module.exports= { student, studentSchema };