while connecting mongo db using mongoose “TypeError: Cannot read property 'message' of undefined”

15
May 15, 2019, at 10:50 PM

After npm update, I am getting this error.

TypeError: Cannot read property 'message' of undefined . 
    at new MongoError (testuser/node_modules/mongodb-core/lib/error.js:22:23)  
    at new MongoNetworkError (testuser//node_modules/mongodb-core/lib/error.js:60:5) . 
    at TLSSocket.err (testuser//node_modules/mongodb-core/lib/connection/connect.js:287:16) . 
    at Object.onceWrapper (events.js:277:13) . 
    at TLSSocket.emit (events.js:189:13)  
    at TLSSocket.Socket._onTimeout (net.js:440:8) . 
    at ontimeout (timers.js:436:11) . 
    at tryOnTimeout (timers.js:300:5) . 
    at listOnTimeout (timers.js:263:5) . 
    at Timer.processTimers (timers.js:223:10) . 

While connecting the MongoDB: Following are the mongo connect code:

mongoose.connect(Mongo.MONGO_URL, {
  user: Mongo.MONGO_USER,
  pass: Mongo.MONGO_PASSWORD,
  useNewUrlParser: true,
  useCreateIndex: true,
  socketTimeoutMS: 0,
  keepAlive: true,
  reconnectTries: 30
});
READ ALSO
Keycloak Policy Enforcing for nodejs REST Api

Keycloak Policy Enforcing for nodejs REST Api

It's the first time asking something here, so excuse if I forget to provide some information or any other mistakesSorry for the text wall

49
Sum of n number inside array is x number and create subset of result

Sum of n number inside array is x number and create subset of result

For example, if you have an array [20, 6, 7, 8, 50] and if I pass value 21 it should return [6,7,8] this sub arrayNote: the sum of number should be in sequence

13
Initializing multiple dbs with async await at the top level in node

Initializing multiple dbs with async await at the top level in node

I understand from a couple of similar questions that to use async await at the top level, it is necessary to wrap up anonymous functions

10