Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some new warnings on [MONGODB DRIVER] #13391

Closed
2 of 4 tasks
sibelius opened this issue May 10, 2023 · 3 comments
Closed
2 of 4 tasks

some new warnings on [MONGODB DRIVER] #13391

sibelius opened this issue May 10, 2023 · 3 comments
Labels
docs This issue is due to a mistake or omission in the mongoosejs.com documentation help This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary
Milestone

Comments

@sibelius
Copy link
Contributor

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Mongoose version

7.1.0

Node.js version

20.1.0

MongoDB server version

5.3.0

Typescript version (if applicable)

5.0.4

Description

2 new warnings when using mongoose v7

(node:338) [MONGODB DRIVER] Warning: keepAlive is a deprecated option: Will not be able to turn off in the future.
(node:338) [MONGODB DRIVER] Warning: keepAliveInitialDelay is a deprecated option: Will not be configurable in the future.

  • keepAlive
  • keepAliveInitialDelay

Steps to Reproduce

just use mongoose v7

Expected Behavior

do not show any warning

@vkarpov15 vkarpov15 added this to the 7.1.2 milestone May 11, 2023
@vkarpov15 vkarpov15 added docs This issue is due to a mistake or omission in the mongoosejs.com documentation help This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary labels May 11, 2023
@vkarpov15 vkarpov15 modified the milestones: 7.1.2, 7.2.1 May 19, 2023
@vkarpov15
Copy link
Collaborator

Are you setting the keepAlive and keepAliveInitialDelay options? Because Mongoose doesn't set those.

The MongoDB Node driver is deprecating those options. The recommended approach is to remove those options, because keepAlive defaults to true in Mongoose >= 5.2.0 anyway.

@sibelius
Copy link
Contributor Author

We can close this, we were using this only on tests, it was helping with timeouts on tests

Should we just remove or is there some replacement?

vkarpov15 added a commit that referenced this issue May 23, 2023
docs(connections): add details about `keepAlive` deprecation
@vkarpov15
Copy link
Collaborator

Just remove it. keepAlive: true does nothing since keepAlive is true by default, and there isn't really much need to set keepAliveInitialDelay. We had that option in the connection docs just as a copy/paste.

If you have problems with timeouts in your tests after removing these options, please post a note here and we'll help you debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This issue is due to a mistake or omission in the mongoosejs.com documentation help This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary
Projects
None yet
Development

No branches or pull requests

2 participants