-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.js
60 lines (59 loc) · 1.31 KB
/
models.js
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
let mongoose = require('mongoose');
module.exports = {
user: mongoose.model(
'user',
new mongoose.Schema({
first_name: String,
name: String,
pwd: String,
mail: String,
roles: [String]
})
),
class: mongoose.model(
'class',
new mongoose.Schema({
name: String,
level: String,
subjects: [{
ref: String,
name: String
}],
students: [{
ref: String,
name: String
}]
})
),
subject: mongoose.model(
'subject',
new mongoose.Schema({
name: String,
teachers: [{
ref: String,
name: String
}]
})
),
mark: mongoose.model(
'mark',
new mongoose.Schema({
student: {
ref: String,
name: String
},
teacher: {
ref: String,
name: String
},
subject: {
ref: String,
name: String
},
score: Number,
score_max: Number,
coefficient: Number,
date: Date
})
)
};