From 4dc3233b75c66da7956b61f30bb19b3a300d2716 Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Mon, 14 Aug 2023 12:53:38 -0400 Subject: [PATCH] docs(migrating_to_6): add note about incompatible packages Re: #12671 --- docs/migrating_to_6.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/migrating_to_6.md b/docs/migrating_to_6.md index d1828c7d7c..36d670fc34 100644 --- a/docs/migrating_to_6.md +++ b/docs/migrating_to_6.md @@ -52,6 +52,7 @@ If you're still on Mongoose 4.x, please read the [Mongoose 4.x to 5.x migration * [`toObject()` and `toJSON()` Use Nested Schema `minimize`](#toobject-and-tojson-use-nested-schema-minimize) * [TypeScript changes](#typescript-changes) * [Removed `reconnectTries` and `reconnectInterval` options](#removed-reconnecttries-and-reconnectinterval-options) +* [MongoDB Driver's New URL Parser Incompatible with Some npm Packages](#mongodb-drivers-new-url-parser-incompatible-with-some-npm-packages)

Version Requirements

@@ -497,6 +498,12 @@ In Mongoose 6, populating a path with no `ref`, `refPath`, or `model` is a no-op await Test.findOne().populate('parents'); ``` +

MongoDB Driver's New URL Parser Incompatible with Some npm Packages

+ +The MongoDB Node driver version that Mongoose 6 uses relies on a [URL parser module](https://npmjs.com/package/whatwg-url) that has several known compatibility issues with other npm packages. +This can lead to errors like `Invalid URL: mongodb+srv://username:password@development.xyz.mongodb.net/abc` if you use one of the incompatible packages. +[You can find a list of incompatible packages here](https://mongoosejs.com/docs/incompatible_packages). + ## 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)`