add get courses without filters and get courses count

parent 1a4c4d29
......@@ -19,6 +19,13 @@ module.exports = function (Course) {
},
removeCourseById : function (courseId) {
return dbUtils.dbRemoveItem(Course, {_id: courseId});
},
getCourses : function (skip, limit) {
return dbUtils.dbFind(Course, {}, [{ path: 'owner', select: 'name surname' }], skip, limit);
},
getCoursesCount : function () {
return dbUtils.dbCount(Course, {});
}
};
};
{
"name": "mirera-db",
"version": "1.4.0",
"version": "1.4.1",
"description": "DB utils for mirera program testing server",
"main": "index.js",
"scripts": {
......@@ -15,7 +15,7 @@
"db"
],
"dependencies": {
"db-utils": "git+https://git.niisi.ru/mirera/db-utils.git#934e047bcecf01021e2923f6d3610250cf19f75a"
"db-utils": "git+https://git.niisi.ru/mirera/db-utils.git#d3382109f110df229fd27a6ab8e6fc073f349504"
},
"author": "Danila Eremin",
"license": "MIT"
......
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