diff options
| author | Nana Nosirova <nargiza.nosirova@mail.utoronto.ca> | 2018-07-17 02:44:47 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-07-17 02:44:47 +0000 |
| commit | 62b53c0971765a4e5f5d447188eb90bd22571424 (patch) | |
| tree | d2f7aa3f3bb7b05cd5d3dee288eabf0f38d39b1a /node_simple.js | |
| parent | 541341598d5ed0e5c8ef9b2325dc6bbec958463a (diff) | |
| parent | 27f1cff089254b678bfcc695ab40b23a6a65a998 (diff) | |
Merge pull request #4 from kdam0/feat/SR-35
Feat/sr 35
Diffstat (limited to 'node_simple.js')
| -rw-r--r-- | node_simple.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/node_simple.js b/node_simple.js index 2f49360..f07c0e8 100644 --- a/node_simple.js +++ b/node_simple.js @@ -648,6 +648,24 @@ exports.updatePassword = function (email, password, callback) { /************************* COURSES / EXAMS **********************************/ + +/** + * Find all UNIQUE course codes from EXAMS collection + * + * @param {function} callback: 2 args: (<string>), + * where <string> : couseCodes array + */ +exports.find_all_course_codes_from_exams = function (callback) { + var exams = db.collection('exams'); + exams.distinct("course_code", function (err, result) { + if (err) callback(false, "Failed to get unique courses"); + else { + callback(true, result); + } + }); +}; + + /** * Remvove a course from ONLY the courses table IN CASE of accidental * addition. @@ -1435,4 +1453,4 @@ exports.getNotifications = function(email, callback) { }); -}
\ No newline at end of file +} |
