I'm connecting to a mongoose db, and I get a deprecation warning every time I try to connect.
(node:14933) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
I set useUnifiedTopology
to true but I'm still getting the error. What am I doing wrong and how can I fix it?
const mongooseOptions = {
useNewUrlParser: true,
useCreateIndex: true,
useFindAndModify: false,
useUnifiedTopology: true,
};
const dbUrl = config.get('dbUrl');
await mongoose.connect(dbUrl, mongooseOptions);
*reconnect*
options? Could there be anywhere else a connection is made from? – Mattconst agenda = new Agenda({ db: { address: dbUrl }, processEvery: '1 seconds', });
shud i be using the same connection? – Jessica