Skip to content

Commit

Permalink
Update migrating_to_6.md about mongoose.modelSchemas
Browse files Browse the repository at this point in the history
It was removed by this commit that first appeared in the 6.x series:

6865fea
  • Loading branch information
markstos committed Sep 30, 2024
1 parent 25da2ca commit fd2081c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/migrating_to_6.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ If you're still on Mongoose 4.x, please read the [Mongoose 4.x to 5.x migration
* [TypeScript changes](#typescript-changes)
* [Removed `reconnectTries` and `reconnectInterval` options](#removed-reconnecttries-and-reconnectinterval-options)
* [Lodash `.isEmpty()` returns false for ObjectIds](#lodash-object-id)
* [mongoose.modelSchemas removed](#model-schemas)

<h2 id="version-requirements"><a href="#version-requirements">Version Requirements</a></h2>

Expand Down Expand Up @@ -557,5 +558,16 @@ if (!(val instanceof Types.ObjectId) && _.isEmpty(val)) {
// Handle empty object here
}
```
<h2 id="model-schemas"><a href="#model-schemas">Removed <code>mongoose.modelSchemas</code></a></h2>

The `mongoose.modelSchemas` property was removed. This may have been used to delete a model schema.

```javascript
// before
delete mongoose.modelSchemas.User;

// with Mongoose 6.x
delete mongoose.deleteModel('User');
```


0 comments on commit fd2081c

Please sign in to comment.