You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm submitting a ...
[ ] bug report
[ X ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
Client connections are currently a one-time operation that has it's set up code inside the MongoStore constructor. I like to have a method that allows developers to swap out the client connection after MongoStore has been instantiated.
This feature would address issues where a MongoDB connection is closed, which currently crashes connect-mongo as it's not able to swap out the original disconnected client. It could also be useful for other circumstances.
Other information (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
I've built a fix for this that basically just moves most of the constructor logic into a method called connectClient and calls that method from the constructor instead:
I'm submitting a ...
[ ] bug report
[ X ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
Client connections are currently a one-time operation that has it's set up code inside the
MongoStore
constructor. I like to have a method that allows developers to swap out the client connection afterMongoStore
has been instantiated.This feature would address issues where a MongoDB connection is closed, which currently crashes connect-mongo as it's not able to swap out the original disconnected client. It could also be useful for other circumstances.
I've built a fix for this that basically just moves most of the constructor logic into a method called
connectClient
and calls that method from the constructor instead:This allows the developer to swap out a client whenever they want:
The text was updated successfully, but these errors were encountered: