Справка:https://mongoosejs.com/docs/deprecations.html
Добавете параметър:useFindAndModify:false
Например код:
mongoose.connect(
MONGODB_URL, {
useFindAndModify: false
},
(err, db) => {
if (err) throw err;
console.log(`MongoDB connected on port ${MONGODB_PORT}`);
}
);