When using useUnifiedTopology: true, mongoose connection status is not always updated #8692
Labels
help
This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary
Do you want to request a feature or report a bug?
A bug
What is the current behavior?
When using
useUnifiedTopology: true
, mongoose connection status is not updated according to underlying Mongo instance disconnecting and reconnecting. Also "disconnected" and "reconnected" events are not always fired.If the current behavior is a bug, please provide the steps to reproduce.
I have the following code:
And I use the following test script, which starts and stops Mongo regularly (mind the killall!)
The log is as follows:
As you can see, state is not always updated. If I comment or remove
useUnifiedTopology: true
, the status is always updated, but I get the deprecation warning:What is the expected behavior?
I would expect the status to always update when using
useUnifiedTopology: true
.What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
The text was updated successfully, but these errors were encountered: