aboutsummaryrefslogtreecommitdiff
path: root/node_simple.js
diff options
context:
space:
mode:
authorDamani Pradyumn <kumar.damani@mail.utoronto.ca>2016-07-24 20:01:28 +0000
committerDamani Pradyumn <kumar.damani@mail.utoronto.ca>2016-07-24 20:01:28 +0000
commit1db8b59bbf49ac4350034385433ffeca5856af83 (patch)
treed14ed2f47f34a7fe9ec0831a7b903d8d94450cff /node_simple.js
parent75c7904f370d8decacc3aaebbbdc5419b21eee64 (diff)
removed extra search exams function
Diffstat (limited to 'node_simple.js')
-rw-r--r--node_simple.js46
1 files changed, 0 insertions, 46 deletions
diff --git a/node_simple.js b/node_simple.js
index 6117b01..bd89476 100644
--- a/node_simple.js
+++ b/node_simple.js
@@ -109,52 +109,6 @@ exports.remove_course = function (course_code, callback) {
};
-exports.search_exams = function ( token, callback ) {
-
- mongoFactory.getConnection(uri).then(function (db) {
- var exams = db.collection('exams');
-
- exams.find(
- { $text: { $search: token } },
- { score: { $meta: "textScore" } } // the strength of the exams
- ).sort({ year: -1}).toArray( function (err, docs) { // order by year
- if (err) throw err;
-
- else { // get the title
- // callback(true, docs);
- // console.log(docs);
- exports.find_course(token.toUpperCase(), function (result, data) {
-
- // console.log("here");
-
- if (result == true) {
- // append the title from data to each exam object from docs
- docs.forEach(function (doc) {
- doc.title = data[0].title;
- });
-
- // if (debug_mode == true){
- // console.log(docs);
- // console.log(data);
- // }
- /*callback(docs); // send back the data*/
- }
- else if (result == false) { // no such course was found
- console.log("This course has not been added to the database.");
- }
- callback(true, docs); // send back the data
-
- });
- }
- });
-
- // db.close();
-
- }).catch(function (err) {
- console.error(err);
- });
-};
-
/*This function will remove the user given user_name from the users table
* and the logins table. So far.