thenativeweb / node-eventstore

EventStore Implementation in node.js
http://eventstore.js.org/
MIT License
539 stars 117 forks source link

Mongo URL parser deprecated. #143

Closed eechava6 closed 4 years ago

eechava6 commented 5 years ago

Hi, working with eventstore, when DB is mongoDB it displays the following warning:

(node:55180) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.

Solved that adding


  if (isNew) {
    defaultOpt.autoReconnect = false;
    defaultOpt.useNewUrlParser = true;   // <--- add this to remove warning
    _.defaults(options.options, defaultOpt);
  } else {
    defaultOpt.auto_reconnect = false;
    _.defaults(options.options, defaultOpt);
  }

Line = 98 File = mongodb.js Path = eventstore/lib/databases/

(If you want I can make pull request with the fix)

adrai commented 5 years ago

It's in the master codebase now, if ok for you I will not immediately create a new version. Unless it's very important for you.

susannaroden commented 4 years ago

Since this is in master now, I am going to close this.