From fd2081c06da60644d927002f65b89c507d802c1a Mon Sep 17 00:00:00 2001 From: Mark Stosberg Date: Mon, 30 Sep 2024 14:19:06 -0400 Subject: [PATCH] Update migrating_to_6.md about mongoose.modelSchemas It was removed by this commit that first appeared in the 6.x series: 6865fea216220a88d2e7128d3a8eb8228f29155e --- docs/migrating_to_6.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/migrating_to_6.md b/docs/migrating_to_6.md index 69945f4eb0..f92ac92957 100644 --- a/docs/migrating_to_6.md +++ b/docs/migrating_to_6.md @@ -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)

Version Requirements

@@ -557,5 +558,16 @@ if (!(val instanceof Types.ObjectId) && _.isEmpty(val)) { // Handle empty object here } ``` +

Removed mongoose.modelSchemas

+ +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'); +```