diff --git a/docs/migrating_to_6.md b/docs/migrating_to_6.md index 1f8a632f7d..7f672bcad7 100644 --- a/docs/migrating_to_6.md +++ b/docs/migrating_to_6.md @@ -153,6 +153,7 @@ However, this behavior was a source of confusion in some cases, so in Mongoose 7 ```javascript mongoose.set('strictQuery', false); ``` + In a test suite, it may be useful to set `strictQuery` to `throw`, which will throw exceptions any time a query references schema that doesn't exist, which could help identify a bug in your tests or code. Here's an example of the effect of `strictQuery`: @@ -520,7 +521,7 @@ The `reconnectTries` and `reconnectInterval` options have been removed since the The MongoDB node driver will always attempt to retry any operation for up to `serverSelectionTimeoutMS`, even if MongoDB is down for a long period of time. So, it will never run out of retries or try to reconnect to MongoDB. -## Lodash `.isEmpty()` returns true for ObjectIds #{lodash-object-id} +## Lodash `.isEmpty()` returns true for ObjectIds {#lodash-object-id} Lodash's `isEmpty()` function returns true for primitives and primitive wrappers. `ObjectId()` is an object wrapper that is treated as a primitive by Mongoose. @@ -534,7 +535,7 @@ if (!(val instanceof Types.ObjectId) && _.isEmpty(val)) { } ``` -## Removed `mongoose.modelSchemas` #{model-schemas} +## Removed `mongoose.modelSchemas` {#model-schemas} The `mongoose.modelSchemas` property was removed. This may have been used to delete a model schema. @@ -546,7 +547,6 @@ delete mongoose.modelSchemas.User; delete mongoose.deleteModel('User'); ``` - ## TypeScript changes The `Schema` class now takes 3 generic params instead of 4. The 3rd generic param, `SchemaDefinitionType`, is now the same as the 1st generic param `DocType`. Replace `new Schema(schemaDefinition)` with `new Schema(schemaDefinition)` diff --git a/docs/migrating_to_7.md b/docs/migrating_to_7.md index ad9af6f9d1..4283c41b6d 100644 --- a/docs/migrating_to_7.md +++ b/docs/migrating_to_7.md @@ -339,7 +339,7 @@ If you want to use Bluebird for all promises globally, you can do the following: global.Promise = require('bluebird'); ``` -## Deprecated `keepAlive` #{deprecated-keepalive} +## Deprecated `keepAlive` {#deprecated-keepalive} 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.