diff options
| author | nanalelfe <nargiza.nosirova@mail.utoronto.ca> | 2016-07-25 07:48:00 +0000 |
|---|---|---|
| committer | nanalelfe <nargiza.nosirova@mail.utoronto.ca> | 2016-07-25 07:48:00 +0000 |
| commit | badc34373b4e474d9bf443e36e6bbe5669eb9556 (patch) | |
| tree | 95bee85d8c2da59ada3ac9ef7bae464873912a37 /node_simple.js | |
| parent | 1032205c1a94ae31d780d2c339abbe628eb27fae (diff) | |
need pulL
Diffstat (limited to 'node_simple.js')
| -rw-r--r-- | node_simple.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/node_simple.js b/node_simple.js index 0290519..426570a 100644 --- a/node_simple.js +++ b/node_simple.js @@ -330,7 +330,7 @@ exports.retrieve_userComments_history = function (username, callback) { // get a connection mongoFactory.getConnection(uri).then(function (db) { - + console.log("for Each here"); var solutions = db.collection('solutions'); var exams = db.collection('exams'); var mylist = []; @@ -350,8 +350,10 @@ exports.retrieve_userComments_history = function (username, callback) { _id: 0 }} ]).toArray(function (err, res) { + console.log("for Each here"); var finised = _.after(res.length, doCall); // execute "doCall" only after res.length # of attempts res.forEach(function (comment) { + console.log("for Each here"); exams.find( { _id: ObjectId(comment.exam_id) } ).toArray(function (err, docs) { // get the exam info comment.course_code = docs[0].course_code; comment.year = docs[0].year; @@ -363,6 +365,7 @@ exports.retrieve_userComments_history = function (username, callback) { }); function doCall() { + console.log("Am i inside the doCall()"); callback(true, mylist); console.log("IN NODE SIMPLE: " + mylist); } |
