I wanted to add to the discussion for those who came to this thread after searching for a solution. I made the above updates to “mongoose” and was still getting the error message.
I forgot that I was also connecting using a MongoDB transport for Winston.
If you are using “winston-mongodb” don’t forget to add options:
winston.add(
new winston.transports.MongoDB({
db: 'mongodb://localhost/vidly',
level: 'error',
options: { useUnifiedTopology: true },
})
);