Skip to content

Commit

Permalink
docs(migrating_to_7): add note about keepAlive to Mongoose 7 migratio…
Browse files Browse the repository at this point in the history
…n guide

Re: #13431
  • Loading branch information
vkarpov15 committed Nov 12, 2024
1 parent 2706aeb commit e7527aa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/migrating_to_7.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ If you're still on Mongoose 5.x, please read the [Mongoose 5.x to 6.x migration
* [ObjectId bsontype now has lowercase d](#objectid-bsontype-now-has-lowercase-d)
* [Removed support for custom promise libraries](#removed-support-for-custom-promise-libraries)
* [Removed mapReduce](#removed-mapreduce)
* [Deprecated `keepAlive`](#deprecated-keepalive)
* [TypeScript-specific changes](#typescript-specific-changes)
* [Removed `LeanDocument` and support for `extends Document`](#removed-leandocument-and-support-for-extends-document)
* [New parameters for `HydratedDocument`](#new-parameters-for-hydrateddocument)
Expand Down Expand Up @@ -335,6 +336,12 @@ If you want to use Bluebird for all promises globally, you can do the following:
global.Promise = require('bluebird');
```

<h2 id="deprecated-keepalive"><a href="#deprecated-keepalive">Deprecated <code>keepAlive</code></a></h2>

Before Mongoose 5.2.0, you needed to enable the `keepAlive` option to initiate [TCP keepalive](https://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html) to prevent `"connection closed"` errors.
However, `keepAlive` has been `true` by default since Mongoose 5.2.0, and the `keepAlive` is deprecated as of Mongoose 7.2.0.
Please remove `keepAlive` and `keepAliveInitialDelay` options from your Mongoose connections.

<h2 id="typescript-specific-changes"><a href="#typescript-specific-changes">TypeScript-specific Changes</a></h2>

<h3 id="removed-leandocument-and-support-for-extends-document"><a href="#removed-leandocument-and-support-for-extends-document">Removed <code>LeanDocument</code> and support for <code>extends Document</code></a></h3>
Expand Down

0 comments on commit e7527aa

Please sign in to comment.