Advertisement
Guest User

Untitled

a guest
Sep 13th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. node.js:134
  2. throw e; // process.nextTick error, or 'error' event on first tick
  3. ^
  4. TypeError: undefined is not a function
  5. at CALL_NON_FUNCTION_AS_CONSTRUCTOR (native)
  6. at Object.<anonymous> (/nodetest/node-mongo/index.js:8:13)
  7. at Module._compile (module.js:404:26)
  8. at Object..js (module.js:410:10)
  9. at Module.load (module.js:336:31)
  10. at Function._load (module.js:297:12)
  11. at Array.<anonymous> (module.js:423:10)
  12. at EventEmitter._tickCallback (node.js:126:26)
  13.  
  14.  
  15.  
  16. //CODE
  17.  
  18.  
  19.  
  20. var mongodb = require('mongodb/lib/mongodb');
  21.  
  22. var mongo = new mongodb.MongoDB();
  23.  
  24. mongo.addListener('close', function(){
  25. sys.puts('Closing Connection');
  26. });
  27.  
  28.  
  29.  
  30.  
  31. mongo.connect({
  32. hostname: 'dbh10.mongolab.com',
  33. port: 27107,
  34. db: 'alohadataset',
  35. username: 'user',
  36. password: 'pass'
  37. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement