You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/migrating_to_6.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -153,6 +153,7 @@ However, this behavior was a source of confusion in some cases, so in Mongoose 7
153
153
```javascript
154
154
mongoose.set('strictQuery', false);
155
155
```
156
+
156
157
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.
157
158
158
159
Here's an example of the effect of `strictQuery`:
@@ -520,7 +521,7 @@ The `reconnectTries` and `reconnectInterval` options have been removed since the
520
521
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.
521
522
So, it will never run out of retries or try to reconnect to MongoDB.
522
523
523
-
## Lodash `.isEmpty()` returns true for ObjectIds #{lodash-object-id}
524
+
## Lodash `.isEmpty()` returns true for ObjectIds {#lodash-object-id}
524
525
525
526
Lodash's `isEmpty()` function returns true for primitives and primitive wrappers.
526
527
`ObjectId()` is an object wrapper that is treated as a primitive by Mongoose.
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<UserDocument, UserModel, User>(schemaDefinition)` with `new Schema<UserDocument, UserModel>(schemaDefinition)`
Copy file name to clipboardExpand all lines: docs/migrating_to_7.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -339,7 +339,7 @@ If you want to use Bluebird for all promises globally, you can do the following:
339
339
global.Promise=require('bluebird');
340
340
```
341
341
342
-
## Deprecated `keepAlive`#{deprecated-keepalive}
342
+
## Deprecated `keepAlive`{#deprecated-keepalive}
343
343
344
344
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.
345
345
However, `keepAlive` has been `true` by default since Mongoose 5.2.0, and the `keepAlive` is deprecated as of Mongoose 7.2.0.
0 commit comments