add getting courses by ids array

parent 9d592480
......@@ -17,6 +17,9 @@ module.exports = function (Course) {
getCourseById : function (courseId) {
return dbUtils.dbFindOne(Course, {_id: courseId}, [{ path: 'owner' }]);
},
getCourseByIds : function (courseIds) {
return dbUtils.dbFind(Course, {_id: {$in : courseIds}});
},
getCoursesByOwner : function (owner) {
return dbUtils.dbFind(Course, {owner: owner}, {population : [{ path: 'owner' }]});
},
......
{
"name": "mirera-db",
"version": "1.5.4",
"version": "1.5.5",
"description": "DB utils for mirera program testing server",
"main": "index.js",
"scripts": {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment