Skip to content

Commit

Permalink
Merge pull request #14919 from markstos/task/document-modelSchema-rem…
Browse files Browse the repository at this point in the history
…oval

Update migrating_to_6.md about mongoose.modelSchemas
  • Loading branch information
vkarpov15 authored Oct 4, 2024
2 parents 25da2ca + fd2081c commit c068e2f
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 c068e2f

Please sign in to comment.