1 const db
= require("../utils/database");
10 * description: varchar
11 * password: monitoring password hash
13 * number: student number
19 getByUser: function(uid
, callback
)
27 getById: function(cid
, callback
)
35 getByPath: function(uid
, code
, callback
)
48 insert: function(uid
, code
, description
, cb
)
54 description: description
,
60 setStudents: function(cid
, students
, cb
)
64 { $set: { students: students
} },
69 // Note: return { students: { ... } }, pointing on the requested row
70 getStudent: function(cid
, number
, cb
)
76 students: { $elemMatch: {number: number
} }
82 setPassword: function(cid
, pwd
, cb
)
86 { $set: { password: pwd
} },
91 remove: function(cid
, cb
)
100 module
.exports
= CourseEntity
;