From 43ff55c9d701625a95842710cb5330661f0d059f Mon Sep 17 00:00:00 2001 From: Luca Pizzini Date: Fri, 24 Feb 2023 11:56:20 +0100 Subject: [PATCH 1/5] docs(migrating_to_6): added info about removal of reconnectTries and reconnectInterval options closes #13071 --- docs/migrating_to_6.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/migrating_to_6.md b/docs/migrating_to_6.md index d7b97ba6dad..69f9cb52140 100644 --- a/docs/migrating_to_6.md +++ b/docs/migrating_to_6.md @@ -48,6 +48,7 @@ If you're still on Mongoose 4.x, please read the [Mongoose 4.x to 5.x migration * [No default model for `Query.prototype.populate()`](#no-default-model-for-query-prototype-populate) * [`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)

Version Requirements

@@ -530,3 +531,10 @@ schema.virtual('myVirtual').get(function() { this.name; // string }); ``` + +## Removed `reconnectTries` and `reconnectInterval` options + +The `reconnectTries` and `reconnectInterval` options have been removed since they are no longer necessary. + +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. +So, it will never run out of retries or try to reconnect to MongoDB. \ No newline at end of file From 0f42367fa798de81863fbd343d7a1c6c6dcb517a Mon Sep 17 00:00:00 2001 From: Luca Pizzini Date: Fri, 24 Feb 2023 15:10:29 +0100 Subject: [PATCH 2/5] fix: changed header formatting --- docs/migrating_to_6.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/migrating_to_6.md b/docs/migrating_to_6.md index 69f9cb52140..42f5d2d1fe9 100644 --- a/docs/migrating_to_6.md +++ b/docs/migrating_to_6.md @@ -532,7 +532,7 @@ schema.virtual('myVirtual').get(function() { }); ``` -## Removed `reconnectTries` and `reconnectInterval` options +

Removed reconnectTries and reconnectInterval options

The `reconnectTries` and `reconnectInterval` options have been removed since they are no longer necessary. From 2195a34bba1e033054ab9b65d264b9989f0fc736 Mon Sep 17 00:00:00 2001 From: hasezoey Date: Fri, 24 Feb 2023 12:07:25 +0100 Subject: [PATCH 3/5] style(schematype): fix name "validators" to "isRequired" as the documentation states --- lib/schematype.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/schematype.js b/lib/schematype.js index 013a2655120..d70db0eee00 100644 --- a/lib/schematype.js +++ b/lib/schematype.js @@ -179,7 +179,7 @@ SchemaType.prototype.validators; * @memberOf SchemaType */ -SchemaType.prototype.validators; +SchemaType.prototype.isRequired; /** * Split the current dottet path into segments From bb5147b7d0df087180f65c92b107ce12841b293e Mon Sep 17 00:00:00 2001 From: hasezoey Date: Mon, 27 Feb 2023 11:33:45 +0100 Subject: [PATCH 4/5] docs(populate): fix using markdown inline codeblocks --- docs/populate.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/populate.md b/docs/populate.md index adc6e8a6d59..85d05b6adaf 100644 --- a/docs/populate.md +++ b/docs/populate.md @@ -49,7 +49,7 @@ user and have a good reason for doing so.
  • Populating multiple existing documents
  • Populating across multiple levels
  • Populating across Databases
  • -
  • Dynamic References via `refPath`
  • +
  • Dynamic References via refPath
  • Populate Virtuals
  • Populate Virtuals: The Count Option
  • Populate Virtuals: The Match Option
  • @@ -275,7 +275,7 @@ story; // null If you want to filter stories by their author's name, you should use [denormalization](https://www.mongodb.com/blog/post/6-rules-of-thumb-for-mongodb-schema-design-part-3). -

    limit vs. perDocumentLimit

    +

    limit vs. perDocumentLimit

    Populate does support a `limit` option, however, it currently does **not** limit on a per-document basis for backwards compatibility. For example, @@ -485,9 +485,8 @@ const events = await Event. populate({ path: 'conversation', model: Conversation }); ``` -

    Dynamic References via `refPath`

    - -Mongoose can also populate from multiple collections based on the value +

    Dynamic References via refPath

    + of a property in the document. Let's say you're building a schema for storing comments. A user may comment on either a blog post or a product. From 063709eb95808e645c7a725ca3c7d54d52e9d157 Mon Sep 17 00:00:00 2001 From: hasezoey Date: Mon, 27 Feb 2023 11:33:58 +0100 Subject: [PATCH 5/5] docs(populate): add missing TOC entry --- docs/populate.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/populate.md b/docs/populate.md index 85d05b6adaf..9026f140fe4 100644 --- a/docs/populate.md +++ b/docs/populate.md @@ -44,6 +44,7 @@ user and have a good reason for doing so.
  • Field Selection
  • Populating Multiple Paths
  • Query conditions and other options
  • +
  • limit vs. perDocumentLimit
  • Refs to children
  • Populating an existing document
  • Populating multiple existing documents