aboutsummaryrefslogtreecommitdiff
path: root/node_simple.js
diff options
context:
space:
mode:
authorHumairAK <humair88@hotmail.com>2016-07-24 00:46:35 +0000
committerHumairAK <humair88@hotmail.com>2016-07-24 00:46:35 +0000
commit18b6e474fb64f7e9b4699d3bfbf3f5276e6996ad (patch)
treedf3a1f71250366ced02579f4f381ec74598861f3 /node_simple.js
parent17d743822746b047b94cd24e5407f1342ba01a7e (diff)
Finished questions, added servercallback for find_exam_byID
Diffstat (limited to 'node_simple.js')
-rw-r--r--node_simple.js6
1 files changed, 3 insertions, 3 deletions
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);
}
});
})