Browse Source

Fixes to node.js code

Christian Kvalheim 12 years ago
parent
commit
5ffc0bf35a
2 changed files with 3 additions and 5 deletions
  1. 2 4
      nodejs/hello.js
  2. 1 1
      nodejs/package.json

+ 2 - 4
nodejs/hello.js

@@ -71,11 +71,9 @@ function mongooseQuery(callback) {
 }
 }
 
 
 function mongodbDriverQuery(callback) {
 function mongodbDriverQuery(callback) {
-  process.nextTick(function() {
-  collection.find({ id: getRandomNumber()}).toArray(function(err, world) {
-    callback(err, world[0]);
+  collection.findOne({ id: getRandomNumber()}, function(err, world) {
+    callback(err, world);
   });
   });
-  })
 }
 }
 
 
 function sequelizeQuery(callback) {
 function sequelizeQuery(callback) {

+ 1 - 1
nodejs/package.json

@@ -7,7 +7,7 @@
     , "sequelize": "1.6.0-beta4"
     , "sequelize": "1.6.0-beta4"
     , "async": "0.2.5"
     , "async": "0.2.5"
     , "mysql": "2.0.0-alpha7"
     , "mysql": "2.0.0-alpha7"
-    , "mongodb": "1.2.14"
+    , "mongodb": "1.3.0"
   }
   }
   , "main": "hello.js"
   , "main": "hello.js"
 }
 }