diff --git a/CHANGELOG.md b/CHANGELOG.md index b3549fabd3..581a153860 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +6.2.11 / 2022-04-13 +=================== + * fix(document): handle validation with triply nested document arrays #11564 + * fix(query): skip applying string schema setters on $regex #11426 + * fix: skip findOneAndReplace() validation if runValidators = false #11559 + * fix(model): correctly handle schema-level collations in syncIndexes() #7621 + * fix(types): correct populate query return type with lean #11560 [mohammad0-0ahmad](https://github.com/mohammad0-0ahmad) + * fix(types): allow using { type: Mixed } as schema type definition for any path #10900 + * docs: fix example on Schema.prototype.post() #11648 [EmilienLeroy](https://github.com/EmilienLeroy) + * docs: fix typo in methods/index.js #11651 [eltociear](https://github.com/eltociear) + 6.2.10 / 2022-04-04 =================== * fix(types): improve lastErrorObject typing for rawResults #11602 [simllll](https://github.com/simllll) diff --git a/lib/schema.js b/lib/schema.js index 517509e8b8..bf400e4cad 100644 --- a/lib/schema.js +++ b/lib/schema.js @@ -1010,6 +1010,7 @@ Schema.prototype.interpretAsType = function(path, obj, options) { if (options.hasOwnProperty('strict')) { childSchemaOptions.strict = options.strict; } + if (this._userProvidedOptions.hasOwnProperty('_id')) { childSchemaOptions._id = this._userProvidedOptions._id; } else if (Schema.Types.DocumentArray.defaultOptions._id != null) { diff --git a/package.json b/package.json index 1aecb5c62a..abbc4a1b6a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mongoose", "description": "Mongoose MongoDB ODM", - "version": "6.2.10", + "version": "6.2.11", "author": "Guillermo Rauch ", "keywords": [ "mongodb",