From 18b6e474fb64f7e9b4699d3bfbf3f5276e6996ad Mon Sep 17 00:00:00 2001 From: HumairAK Date: Sat, 23 Jul 2016 20:46:35 -0400 Subject: Finished questions, added servercallback for find_exam_byID --- node_simple.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'node_simple.js') diff --git a/node_simple.js b/node_simple.js index 2c57d69..fcaa306 100644 --- a/node_simple.js +++ b/node_simple.js @@ -830,7 +830,7 @@ exports.remove_exam = function (fields, serverCallback) { //get_exam_byID("578a44ff71ed097fc3079d6e"); -exports.get_exam_byID = function (id) { +exports.get_exam_byID = function (id, serverCallback) { // establish a connection mongoFactory.getConnection(uri) @@ -842,8 +842,8 @@ exports.get_exam_byID = function (id) { exams.find( {_id: ObjectId(id)} ).toArray(function (err, docs) { if (err) throw err; else { - // console.log(JSON.stringify(docs, null, 2)); - console.log(docs); + serverCallback(docs[0]); + //console.log(docs); } }); }) -- cgit v1.2.3