Skip to content

Conversation

@vkarpov15
Copy link
Collaborator

Summary

Right now there's always a default mongoose.connection. We added a createInitialConnection option that prevents new Mongoose instances from creating a default connection, but that doesn't apply to existing Mongoose instances, including the default one. So there's no way to really "delete" the default connection in the API.

With this PR, mongoose.set('createInitialConnection', false) will also remove the default connection, presuming it isn't connected and there are no models already on it.

Examples

@hasezoey hasezoey added this to the 8.5 milestone Jun 24, 2024
@vkarpov15 vkarpov15 merged commit cd11105 into 8.5 Jun 24, 2024
@hasezoey hasezoey deleted the vkarpov15/gh-8302 branch June 25, 2024 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants