After setting useUnifiedTopology=true
, the Auto Reconnect stopped working and generates the following ERRORS:
DeprecationWarning: The option `reconnectInterval` is incompatible with the unified topology
DeprecationWarning: The option `reconnectTries` is incompatible with the unified topology
DeprecationWarning: The option `autoReconnect` is incompatible with the unified topology
How can i get the server to auto-reconnect with that new flag?
I'm using mongoose.createConnection
to connect with the following options:
{
autoReconnect: true,
keepAliveInitialDelay: 300000,
connectTimeoutMS: 300000,
reconnectTries: Number.MAX_VALUE,
reconnectInterval: 1000,
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex: true,
poolSize: 10,
auth: {
authSource: "admin"
},
user: process.env.MONGO_USER,
pass: process.env.MONGO_PASS
}
autoReconnect
is incompatible with the unified topology, please read more by visiting http://... (node:4642) DeprecationWarning: The optionreconnectTries
is incompatible with the unified topology, please read more by visiting http://... – Amarelle