Skip to content

Commit 572e97a

Browse files
authored
Merge pull request #15032 from Automattic/vkarpov15/gh-13431
docs(migrating_to_7): add note about keepAlive to Mongoose 7 migration guide
2 parents 2706aeb + e7527aa commit 572e97a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/migrating_to_7.md

+7
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ If you're still on Mongoose 5.x, please read the [Mongoose 5.x to 6.x migration
2323
* [ObjectId bsontype now has lowercase d](#objectid-bsontype-now-has-lowercase-d)
2424
* [Removed support for custom promise libraries](#removed-support-for-custom-promise-libraries)
2525
* [Removed mapReduce](#removed-mapreduce)
26+
* [Deprecated `keepAlive`](#deprecated-keepalive)
2627
* [TypeScript-specific changes](#typescript-specific-changes)
2728
* [Removed `LeanDocument` and support for `extends Document`](#removed-leandocument-and-support-for-extends-document)
2829
* [New parameters for `HydratedDocument`](#new-parameters-for-hydrateddocument)
@@ -335,6 +336,12 @@ If you want to use Bluebird for all promises globally, you can do the following:
335336
global.Promise = require('bluebird');
336337
```
337338

339+
<h2 id="deprecated-keepalive"><a href="#deprecated-keepalive">Deprecated <code>keepAlive</code></a></h2>
340+
341+
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.
342+
However, `keepAlive` has been `true` by default since Mongoose 5.2.0, and the `keepAlive` is deprecated as of Mongoose 7.2.0.
343+
Please remove `keepAlive` and `keepAliveInitialDelay` options from your Mongoose connections.
344+
338345
<h2 id="typescript-specific-changes"><a href="#typescript-specific-changes">TypeScript-specific Changes</a></h2>
339346

340347
<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>

0 commit comments

Comments
 (0)