Agenda: MongoDB deprecation warning

Created on 27 Nov 2018  路  5Comments  路  Source: agenda/agenda

(node:85266) 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.

I get this warning using the plugin. Mongo DB 4 is used. Can you please add { useNewUrlParser: true } to the connection options?

Most helpful comment

It looks like you can pass them in an object assigned to Agenda.db.options like so:

const agenda = new Agenda({
  db: {
    address: mongoConnectionString,
    options: {
      useNewUrlParser: true,
    },
  },
});

All 5 comments

I have the same issue.
I use MongoDB string to connect agenda like below:

const mongo = 'mongodb://0.0.0.0:2707/'
const agenda = new Agenda({ db: { address: mongo }, processEvery: '30 seconds' });

the output of mongo is same as above issue.

It looks like you can pass them in an object assigned to Agenda.db.options like so:

const agenda = new Agenda({
  db: {
    address: mongoConnectionString,
    options: {
      useNewUrlParser: true,
    },
  },
});

Hey @simison, @OmgImAlexis, @rschmukler, @vkarpov15 - this is a simple PR. It's OK if you can no longer commit to the project, and it would be nice to enable others to accept PRs.

I've created a new PR for this, all tests have passed it just needs to be reviewed #806

Was this page helpful?
0 / 5 - 0 ratings