From Sole Meerkat, 6 Months ago, written in JavaScript.
  1. I have a mongodb installed and a db named eeToolKit
  2.  
  3. [root@localhost]# node newsUpdater.js
  4. Error: Invalid schema, expected `mongodb` or `mongodb+srv`
  5.     at module.exports (/var/www/html/eetoolkit/eetoolkitv2login/node_modules/mongodb/lib/url_parser.js:21:21)
  6.     at connect (/var/www/html/eetoolkit/eetoolkitv2login/node_modules/mongodb/lib/mongo_client.js:880:3)
  7.     at connectOp (/var/www/html/eetoolkit/eetoolkitv2login/node_modules/mongodb/lib/mongo_client.js:270:3)
  8.     at executeOperation (/var/www/html/eetoolkit/eetoolkitv2login/node_modules/mongodb/lib/utils.js:420:24)
  9.     at MongoClient.connect (/var/www/html/eetoolkit/eetoolkitv2login/node_modules/mongodb/lib/mongo_client.js:261:10)
  10.     at Promise (/var/www/html/eetoolkit/eetoolkitv2login/node_modules/mongoose/lib/connection.js:436:12)
  11.     at new Promise (<anonymous>)
  12.     at NativeConnection.Connection.openUri (/var/www/html/eetoolkit/eetoolkitv2login/node_modules/mongoose/lib/connection.js:433:19)
  13.     at Mongoose.connect (/var/www/html/eetoolkit/eetoolkitv2login/node_modules/mongoose/lib/index.js:208:15)
  14.     at Timeout.newsUpdate [as _onTimeout] (/var/www/html/eetoolkit/eetoolkitv2login/newsUpdater.js:38:33)
  15.     at ontimeout (timers.js:436:11)
  16.     at tryOnTimeout (timers.js:300:5)
  17.     at listOnTimeout (timers.js:263:5)
  18.     at Timer.processTimers (timers.js:223:10)
  19. (node:28598) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
  20.     at maybeCallback (fs.js:129:9)
  21.     at Object.truncate (fs.js:607:14)
  22.     at Timeout.newsUpdate [as _onTimeout] (/var/www/html/eetoolkit/eetoolkitv2login/newsUpdater.js:95:6)
  23. (node:28598) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
  24. (node:28598) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  25.  
  26. from newsUpdater.js
  27.  
  28. const { Schema } = mongoose = require('mongoose');
  29.  
  30. const uri = 'localhost:27017/eeToolKit';
  31.  
  32. mongoose.Promise = global.Promise;
  33. mongoose.set('debug', true);
  34.  
  35. const newsSchema = new Schema({
  36.    serverid: Number,
  37.    resetid: Number,
  38.    newsid: {type: Number, unique: true},
  39.    timestamp: Number,
  40.    type: Number,
  41.    win: Number,
  42.    attacker_num: Number,
  43.    attacker_name: String,
  44.    defender_num: Number,
  45.    defender_name: String,
  46.    result1: Number,
  47.    result2: Number,
  48.    a_tag: String,
  49.    d_tag: String,
  50.    killhit: Number
  51. });
  52.  
  53.  
  54.  
captcha