Próbuję podłączyć się do mongoDB za pomocą mongoose. Pokazuje się taki błąd:
(node:10540) 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.
,pomimo, że posiadam fragment kodu:
const conn = mongoose.createConnection(mongoURI, { useUnifiedTopology: true, useNewUrlParser: true });
Podobny błąd pokazywał się przy useNewUrlParser, ale po dodaniu useNewUrlParser: true zniknął
Próbowałem też:
mongoose.set('useNewUrlParser', true);
mongoose.set('useUnifiedTopology', true);.