Automattic/mongoose (mongoose)
### [`v7.5.2`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#752--2023-09-15)
[Compare Source](https://togithub.com/Automattic/mongoose/compare/7.5.1...7.5.2)
\==================
- fix(schema): handle number discriminator keys when using Schema.prototype.discriminator() [#13858](https://togithub.com/Automattic/mongoose/issues/13858) [#13788](https://togithub.com/Automattic/mongoose/issues/13788)
- fix: ignore `id` property when calling `set()` with both `id` and `_id` specified to avoid `id` setter overwriting [#13762](https://togithub.com/Automattic/mongoose/issues/13762)
- types: pass correct document type to required and default function [#13851](https://togithub.com/Automattic/mongoose/issues/13851) [#13797](https://togithub.com/Automattic/mongoose/issues/13797)
- docs(model): add examples of using diffIndexes() to syncIndexes()and diffIndexes() api docs [#13850](https://togithub.com/Automattic/mongoose/issues/13850) [#13771](https://togithub.com/Automattic/mongoose/issues/13771)
### [`v7.5.1`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#751--2023-09-11)
[Compare Source](https://togithub.com/Automattic/mongoose/compare/7.5.0...7.5.1)
\==================
- fix: set default value for \_update when no update object is provided and versionKey is set to false [#13795](https://togithub.com/Automattic/mongoose/issues/13795) [#13783](https://togithub.com/Automattic/mongoose/issues/13783) [MohOraby](https://togithub.com/MohOraby)
- fix: avoid unexpected error when accessing null array element on discriminator array when populating [#13716](https://togithub.com/Automattic/mongoose/issues/13716) [ZSabakh](https://togithub.com/ZSabakh)
- types(schematypes): use DocType for instance method this [#13822](https://togithub.com/Automattic/mongoose/issues/13822) [#13800](https://togithub.com/Automattic/mongoose/issues/13800) [pshaddel](https://togithub.com/pshaddel)
- types: remove duplicated 'exists' method in Model interface in models.d.ts [#13818](https://togithub.com/Automattic/mongoose/issues/13818) [ohzeno](https://togithub.com/ohzeno)
- docs(model): replace outdated docs on deprecated findOneAndUpdate() overwrite option [#13821](https://togithub.com/Automattic/mongoose/issues/13821) [#13715](https://togithub.com/Automattic/mongoose/issues/13715)
- docs: add example of using `virtuals.pathsToSkip` option for `toObject()` and `toJSON()` [#13798](https://togithub.com/Automattic/mongoose/issues/13798) [RobertHunter-Pluto](https://togithub.com/RobertHunter-Pluto)
### [`v7.5.0`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#750--2023-08-29)
[Compare Source](https://togithub.com/Automattic/mongoose/compare/7.4.5...7.5.0)
\==================
- feat: use mongodb driver v5.18.1
- feat: allow top level dollar keys with findOneAndUpdate(), update() for MongoDB 5 [#13786](https://togithub.com/Automattic/mongoose/issues/13786)
- fix(document): make array getters avoid unintentionally modifying array, defer getters until index access instead [#13774](https://togithub.com/Automattic/mongoose/issues/13774)
- feat: deprecate `overwrite` option for findOneAndUpdate() [#13578](https://togithub.com/Automattic/mongoose/issues/13578)
- feat: add pathsToSkip option for Model.validate [#13663](https://togithub.com/Automattic/mongoose/issues/13663) [#10353](https://togithub.com/Automattic/mongoose/issues/10353)
- feat: support alias when declaring index [#13659](https://togithub.com/Automattic/mongoose/issues/13659) [#13276](https://togithub.com/Automattic/mongoose/issues/13276)
- fix(query): remove unnecessary check for atomic operators in findOneAndReplace() [#13678](https://togithub.com/Automattic/mongoose/issues/13678)
- types: add SearchMeta Interface for Atlas Search [#13792](https://togithub.com/Automattic/mongoose/issues/13792) [mreouven](https://togithub.com/mreouven)
- types(schematypes): add missing BigInt SchemaType [#13787](https://togithub.com/Automattic/mongoose/issues/13787)
### [`v7.4.5`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#745--2023-08-25)
[Compare Source](https://togithub.com/Automattic/mongoose/compare/7.4.4...7.4.5)
\==================
- fix(debug): avoid putting virtuals and getters in debug output [#13778](https://togithub.com/Automattic/mongoose/issues/13778)
- fix(model): make Model.bulkWrite() with empty array and ordered false not throw an error [#13664](https://togithub.com/Automattic/mongoose/issues/13664)
- fix(document): correctly handle inclusive/exclusive projections when applying subdocument defaults [#13763](https://togithub.com/Automattic/mongoose/issues/13763) [#13720](https://togithub.com/Automattic/mongoose/issues/13720)
### [`v7.4.4`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#744--2023-08-22)
[Compare Source](https://togithub.com/Automattic/mongoose/compare/7.4.3...7.4.4)
\==================
- fix(connection): reset document state in between transaction retries [#13726](https://togithub.com/Automattic/mongoose/issues/13726) [#13698](https://togithub.com/Automattic/mongoose/issues/13698)
- fix(cursor): bubble up resumeTokenChanged event from change streams [#13736](https://togithub.com/Automattic/mongoose/issues/13736) [#13607](https://togithub.com/Automattic/mongoose/issues/13607)
- fix(query+populate): add refPath to projection by default, unless explicitly excluded [#13758](https://togithub.com/Automattic/mongoose/issues/13758)
- fix(schema): support 'ascending', 'asc', 'descending', 'desc' for index direction [#13761](https://togithub.com/Automattic/mongoose/issues/13761) [#13725](https://togithub.com/Automattic/mongoose/issues/13725)
- fix(ChangeStream): add \_bindEvents to addListener function for observable support [#13759](https://togithub.com/Automattic/mongoose/issues/13759) [yury-ivaniutsenka](https://togithub.com/yury-ivaniutsenka)
- types: infer return type when using `get()`, `markModified()`, etc. with known property name literal [#13739](https://togithub.com/Automattic/mongoose/issues/13739) [maybesmurf](https://togithub.com/maybesmurf)
- types: add missing typings for option includeResultMetadata [#13747](https://togithub.com/Automattic/mongoose/issues/13747) [#13746](https://togithub.com/Automattic/mongoose/issues/13746) [Idnan](https://togithub.com/Idnan)
- types: export InferSchemaType [#13737](https://togithub.com/Automattic/mongoose/issues/13737)
- docs(middleware): clarify that query middleware applies to document by default [#13734](https://togithub.com/Automattic/mongoose/issues/13734) [#13713](https://togithub.com/Automattic/mongoose/issues/13713)
- docs: add brief note on TypeScript generic usage for embedded discriminator path() calls [#13728](https://togithub.com/Automattic/mongoose/issues/13728) [#10435](https://togithub.com/Automattic/mongoose/issues/10435)
- docs: link v7 migration guide [#13742](https://togithub.com/Automattic/mongoose/issues/13742) [Cooldogyum](https://togithub.com/Cooldogyum)
- docs(migrating_to\_6): add note about incompatible packages [#13733](https://togithub.com/Automattic/mongoose/issues/13733)
### [`v7.4.3`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#743--2023-08-11)
[Compare Source](https://togithub.com/Automattic/mongoose/compare/7.4.2...7.4.3)
\==================
- fix: avoid applying map property getters when saving [#13704](https://togithub.com/Automattic/mongoose/issues/13704) [#13657](https://togithub.com/Automattic/mongoose/issues/13657)
- fix(query): allow deselecting discriminator key [#13722](https://togithub.com/Automattic/mongoose/issues/13722) [#13679](https://togithub.com/Automattic/mongoose/issues/13679)
- types(models+query): return lean type when passing QueryOptions with lean: true to relevant model functions like find() and findOne() [#13721](https://togithub.com/Automattic/mongoose/issues/13721) [#13705](https://togithub.com/Automattic/mongoose/issues/13705)
- types(schema): correct return type for Schema.prototype.indexes() [#13718](https://togithub.com/Automattic/mongoose/issues/13718) [#13702](https://togithub.com/Automattic/mongoose/issues/13702)
- types: allow accessing options from pre middleware [#13708](https://togithub.com/Automattic/mongoose/issues/13708) [#13633](https://togithub.com/Automattic/mongoose/issues/13633)
- types: add UpdateQueryKnownOnly type for stricter UpdateQuery type checking [#13699](https://togithub.com/Automattic/mongoose/issues/13699) [#13630](https://togithub.com/Automattic/mongoose/issues/13630)
- types(schema): support required: { isRequired: true } syntax in schema definition [#13680](https://togithub.com/Automattic/mongoose/issues/13680)
- docs(middleware): clarify that doc.deleteOne() doesn't run query middleware currently [#13707](https://togithub.com/Automattic/mongoose/issues/13707) [#13669](https://togithub.com/Automattic/mongoose/issues/13669)
Configuration
📅 Schedule: Branch creation - "on friday" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate. View repository job log here.
This PR contains the following updates:
7.4.2
->7.5.2
Release Notes
Automattic/mongoose (mongoose)
### [`v7.5.2`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#752--2023-09-15) [Compare Source](https://togithub.com/Automattic/mongoose/compare/7.5.1...7.5.2) \================== - fix(schema): handle number discriminator keys when using Schema.prototype.discriminator() [#13858](https://togithub.com/Automattic/mongoose/issues/13858) [#13788](https://togithub.com/Automattic/mongoose/issues/13788) - fix: ignore `id` property when calling `set()` with both `id` and `_id` specified to avoid `id` setter overwriting [#13762](https://togithub.com/Automattic/mongoose/issues/13762) - types: pass correct document type to required and default function [#13851](https://togithub.com/Automattic/mongoose/issues/13851) [#13797](https://togithub.com/Automattic/mongoose/issues/13797) - docs(model): add examples of using diffIndexes() to syncIndexes()and diffIndexes() api docs [#13850](https://togithub.com/Automattic/mongoose/issues/13850) [#13771](https://togithub.com/Automattic/mongoose/issues/13771) ### [`v7.5.1`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#751--2023-09-11) [Compare Source](https://togithub.com/Automattic/mongoose/compare/7.5.0...7.5.1) \================== - fix: set default value for \_update when no update object is provided and versionKey is set to false [#13795](https://togithub.com/Automattic/mongoose/issues/13795) [#13783](https://togithub.com/Automattic/mongoose/issues/13783) [MohOraby](https://togithub.com/MohOraby) - fix: avoid unexpected error when accessing null array element on discriminator array when populating [#13716](https://togithub.com/Automattic/mongoose/issues/13716) [ZSabakh](https://togithub.com/ZSabakh) - types(schematypes): use DocType for instance method this [#13822](https://togithub.com/Automattic/mongoose/issues/13822) [#13800](https://togithub.com/Automattic/mongoose/issues/13800) [pshaddel](https://togithub.com/pshaddel) - types: remove duplicated 'exists' method in Model interface in models.d.ts [#13818](https://togithub.com/Automattic/mongoose/issues/13818) [ohzeno](https://togithub.com/ohzeno) - docs(model): replace outdated docs on deprecated findOneAndUpdate() overwrite option [#13821](https://togithub.com/Automattic/mongoose/issues/13821) [#13715](https://togithub.com/Automattic/mongoose/issues/13715) - docs: add example of using `virtuals.pathsToSkip` option for `toObject()` and `toJSON()` [#13798](https://togithub.com/Automattic/mongoose/issues/13798) [RobertHunter-Pluto](https://togithub.com/RobertHunter-Pluto) ### [`v7.5.0`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#750--2023-08-29) [Compare Source](https://togithub.com/Automattic/mongoose/compare/7.4.5...7.5.0) \================== - feat: use mongodb driver v5.18.1 - feat: allow top level dollar keys with findOneAndUpdate(), update() for MongoDB 5 [#13786](https://togithub.com/Automattic/mongoose/issues/13786) - fix(document): make array getters avoid unintentionally modifying array, defer getters until index access instead [#13774](https://togithub.com/Automattic/mongoose/issues/13774) - feat: deprecate `overwrite` option for findOneAndUpdate() [#13578](https://togithub.com/Automattic/mongoose/issues/13578) - feat: add pathsToSkip option for Model.validate [#13663](https://togithub.com/Automattic/mongoose/issues/13663) [#10353](https://togithub.com/Automattic/mongoose/issues/10353) - feat: support alias when declaring index [#13659](https://togithub.com/Automattic/mongoose/issues/13659) [#13276](https://togithub.com/Automattic/mongoose/issues/13276) - fix(query): remove unnecessary check for atomic operators in findOneAndReplace() [#13678](https://togithub.com/Automattic/mongoose/issues/13678) - types: add SearchMeta Interface for Atlas Search [#13792](https://togithub.com/Automattic/mongoose/issues/13792) [mreouven](https://togithub.com/mreouven) - types(schematypes): add missing BigInt SchemaType [#13787](https://togithub.com/Automattic/mongoose/issues/13787) ### [`v7.4.5`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#745--2023-08-25) [Compare Source](https://togithub.com/Automattic/mongoose/compare/7.4.4...7.4.5) \================== - fix(debug): avoid putting virtuals and getters in debug output [#13778](https://togithub.com/Automattic/mongoose/issues/13778) - fix(model): make Model.bulkWrite() with empty array and ordered false not throw an error [#13664](https://togithub.com/Automattic/mongoose/issues/13664) - fix(document): correctly handle inclusive/exclusive projections when applying subdocument defaults [#13763](https://togithub.com/Automattic/mongoose/issues/13763) [#13720](https://togithub.com/Automattic/mongoose/issues/13720) ### [`v7.4.4`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#744--2023-08-22) [Compare Source](https://togithub.com/Automattic/mongoose/compare/7.4.3...7.4.4) \================== - fix(connection): reset document state in between transaction retries [#13726](https://togithub.com/Automattic/mongoose/issues/13726) [#13698](https://togithub.com/Automattic/mongoose/issues/13698) - fix(cursor): bubble up resumeTokenChanged event from change streams [#13736](https://togithub.com/Automattic/mongoose/issues/13736) [#13607](https://togithub.com/Automattic/mongoose/issues/13607) - fix(query+populate): add refPath to projection by default, unless explicitly excluded [#13758](https://togithub.com/Automattic/mongoose/issues/13758) - fix(schema): support 'ascending', 'asc', 'descending', 'desc' for index direction [#13761](https://togithub.com/Automattic/mongoose/issues/13761) [#13725](https://togithub.com/Automattic/mongoose/issues/13725) - fix(ChangeStream): add \_bindEvents to addListener function for observable support [#13759](https://togithub.com/Automattic/mongoose/issues/13759) [yury-ivaniutsenka](https://togithub.com/yury-ivaniutsenka) - types: infer return type when using `get()`, `markModified()`, etc. with known property name literal [#13739](https://togithub.com/Automattic/mongoose/issues/13739) [maybesmurf](https://togithub.com/maybesmurf) - types: add missing typings for option includeResultMetadata [#13747](https://togithub.com/Automattic/mongoose/issues/13747) [#13746](https://togithub.com/Automattic/mongoose/issues/13746) [Idnan](https://togithub.com/Idnan) - types: export InferSchemaType [#13737](https://togithub.com/Automattic/mongoose/issues/13737) - docs(middleware): clarify that query middleware applies to document by default [#13734](https://togithub.com/Automattic/mongoose/issues/13734) [#13713](https://togithub.com/Automattic/mongoose/issues/13713) - docs: add brief note on TypeScript generic usage for embedded discriminator path() calls [#13728](https://togithub.com/Automattic/mongoose/issues/13728) [#10435](https://togithub.com/Automattic/mongoose/issues/10435) - docs: link v7 migration guide [#13742](https://togithub.com/Automattic/mongoose/issues/13742) [Cooldogyum](https://togithub.com/Cooldogyum) - docs(migrating_to\_6): add note about incompatible packages [#13733](https://togithub.com/Automattic/mongoose/issues/13733) ### [`v7.4.3`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#743--2023-08-11) [Compare Source](https://togithub.com/Automattic/mongoose/compare/7.4.2...7.4.3) \================== - fix: avoid applying map property getters when saving [#13704](https://togithub.com/Automattic/mongoose/issues/13704) [#13657](https://togithub.com/Automattic/mongoose/issues/13657) - fix(query): allow deselecting discriminator key [#13722](https://togithub.com/Automattic/mongoose/issues/13722) [#13679](https://togithub.com/Automattic/mongoose/issues/13679) - types(models+query): return lean type when passing QueryOptions with lean: true to relevant model functions like find() and findOne() [#13721](https://togithub.com/Automattic/mongoose/issues/13721) [#13705](https://togithub.com/Automattic/mongoose/issues/13705) - types(schema): correct return type for Schema.prototype.indexes() [#13718](https://togithub.com/Automattic/mongoose/issues/13718) [#13702](https://togithub.com/Automattic/mongoose/issues/13702) - types: allow accessing options from pre middleware [#13708](https://togithub.com/Automattic/mongoose/issues/13708) [#13633](https://togithub.com/Automattic/mongoose/issues/13633) - types: add UpdateQueryKnownOnly type for stricter UpdateQuery type checking [#13699](https://togithub.com/Automattic/mongoose/issues/13699) [#13630](https://togithub.com/Automattic/mongoose/issues/13630) - types(schema): support required: { isRequired: true } syntax in schema definition [#13680](https://togithub.com/Automattic/mongoose/issues/13680) - docs(middleware): clarify that doc.deleteOne() doesn't run query middleware currently [#13707](https://togithub.com/Automattic/mongoose/issues/13707) [#13669](https://togithub.com/Automattic/mongoose/issues/13669)Configuration
📅 Schedule: Branch creation - "on friday" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.