Closed renovate[bot] closed 1 year ago
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/yurikrupnik/batman/DmRxVtAvbYzwtnhW3ySN73Khk1iS
✅ Preview: Failed
[Deployment for 7f857c1 failed]
🔍 Inspect: https://vercel.com/yurikrupnik/alfred/7ZUt1DFKTLRKGEeQbE9NqiCmKL4D
✅ Preview: https://alfred-git-renovate-mongoose-6x-yurikrupnik.vercel.app
[Deployment for 7f857c1 failed]
This PR contains the following updates:
5.13.7
->6.4.0
Release Notes
Automattic/mongoose
### [`v6.4.0`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#640--2022-06-17) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.3.9...6.4.0) \================== - feat: upgrade mongodb driver -> 4.7.0 [#11909](https://togithub.com/Automattic/mongoose/issues/11909) [AbdelrahmanHafez](https://togithub.com/AbdelrahmanHafez) - feat(types+document): add $assertPopulated() for working with manually populated paths in TypeScript [#11843](https://togithub.com/Automattic/mongoose/issues/11843) - feat(mongoose): add setDriver() function to allow overwriting driver in a more consistent way [#11900](https://togithub.com/Automattic/mongoose/issues/11900) - feat(types): add helpers to infer schema type automatically [#11563](https://togithub.com/Automattic/mongoose/issues/11563) [mohammad0-0ahmad](https://togithub.com/mohammad0-0ahmad) - feat: add `transform` option to `lean()` [#10423](https://togithub.com/Automattic/mongoose/issues/10423) [IslandRhythms](https://togithub.com/IslandRhythms) - feat(base): add support to set default immutable for createdAt globally [#11888](https://togithub.com/Automattic/mongoose/issues/11888) [AbdelrahmanHafez](https://togithub.com/AbdelrahmanHafez) - fix: make doValidate() on document array elements run validation on the whole subdoc [#11902](https://togithub.com/Automattic/mongoose/issues/11902) - feat(types): add expression typings to Aggregate stages [#11370](https://togithub.com/Automattic/mongoose/issues/11370) [Uzlopak](https://togithub.com/Uzlopak) - fix: remove `on` from schema reserved keys [#11580](https://togithub.com/Automattic/mongoose/issues/11580) [IslandRhythms](https://togithub.com/IslandRhythms) ### [`v6.3.9`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#639--2022-06-17) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.3.8...6.3.9) \================== - fix(document): handle nested paths underneath subdocuments when getting all subdocuments for pre save hooks [#11917](https://togithub.com/Automattic/mongoose/issues/11917) - fix(types): correct typing in post aggregate hooks [#11924](https://togithub.com/Automattic/mongoose/issues/11924) [GCastilho](https://togithub.com/GCastilho) - docs: remove connect-option reconnectTries and reconnectInterval [#11930](https://togithub.com/Automattic/mongoose/issues/11930) [Uzlopak](https://togithub.com/Uzlopak) ### [`v6.3.8`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#638--2022-06-13) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.3.7...6.3.8) \================== - fix: revert [`670b445`](https://togithub.com/Automattic/mongoose/commit/670b445b0fc) perf optimizations that caused some test failures [#11541](https://togithub.com/Automattic/mongoose/issues/11541) ### [`v6.3.7`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#637--2022-06-13) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.3.6...6.3.7) \================== - fix(schema+document): allow disabling \_id on subdocuments by default [#11541](https://togithub.com/Automattic/mongoose/issues/11541) - fix(update): respect global strictQuery option when casting array filters [#11836](https://togithub.com/Automattic/mongoose/issues/11836) - perf(document): avoid unnecessarily creating new options object on every `$set` [#11541](https://togithub.com/Automattic/mongoose/issues/11541) - fix: toJSON with undefined path [#11922](https://togithub.com/Automattic/mongoose/issues/11922) [kerryChen95](https://togithub.com/kerryChen95) - fix: add refPath to SchemaTypeOptions class [#11862](https://togithub.com/Automattic/mongoose/issues/11862) - fix(types): handle boolean default functions [#11828](https://togithub.com/Automattic/mongoose/issues/11828) - docs(populate): make path names in refPath section consistent [#11724](https://togithub.com/Automattic/mongoose/issues/11724) ### [`v6.3.6`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#636--2022-06-07) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.3.5...6.3.6) \================== - fix(update): apply timestamps to nested subdocs within $push and $addToSet [#11775](https://togithub.com/Automattic/mongoose/issues/11775) - fix(document): use shallow clone instead of deep clone for `toObject()` options [#11776](https://togithub.com/Automattic/mongoose/issues/11776) - fix: avoid checking for ObjectId with instanceof [#11891](https://togithub.com/Automattic/mongoose/issues/11891) [noseworthy](https://togithub.com/noseworthy) - fix(types): Allow sorting by text score [#11893](https://togithub.com/Automattic/mongoose/issues/11893) - fix(types): allow schematype get() functions to return undefined [#11561](https://togithub.com/Automattic/mongoose/issues/11561) - fix(types): add Schema.discriminator [#11855](https://togithub.com/Automattic/mongoose/issues/11855) [Uzlopak](https://togithub.com/Uzlopak) - fix(types): discriminator generic type not being passed to schema [#11898](https://togithub.com/Automattic/mongoose/issues/11898) [GCastilho](https://togithub.com/GCastilho) ### [`v6.3.5`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#635--2022-05-30) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.3.4...6.3.5) \================== - fix(document): avoid infinite recursion when calling toObject() on self-referencing document [#11756](https://togithub.com/Automattic/mongoose/issues/11756) - fix(document): avoid manually populating documents that are manually populated in another doc with different unpopulatedValue [#11442](https://togithub.com/Automattic/mongoose/issues/11442) - fix(document): fix ObjectId conversion for external schemas [#11841](https://togithub.com/Automattic/mongoose/issues/11841) [coyotte508](https://togithub.com/coyotte508) - fix: fix codeql warnings [#11817](https://togithub.com/Automattic/mongoose/issues/11817) [Uzlopak](https://togithub.com/Uzlopak) - fix(types): allow passing TVirtuals to Schema class [#11543](https://togithub.com/Automattic/mongoose/issues/11543) - fix(types): Type of Connection.transaction() [#11825](https://togithub.com/Automattic/mongoose/issues/11825) [dwrss](https://togithub.com/dwrss) - docs(typescript): add coverage for TypeScript query helpers [#11709](https://togithub.com/Automattic/mongoose/issues/11709) - docs: fix documention of error handling [#11844](https://togithub.com/Automattic/mongoose/issues/11844) [Uzlopak](https://togithub.com/Uzlopak) - docs: typings mongoose.Error should reference to MongooseError [#11850](https://togithub.com/Automattic/mongoose/issues/11850) [Uzlopak](https://togithub.com/Uzlopak) - chore: improve issue templates [#11794](https://togithub.com/Automattic/mongoose/issues/11794) [Uzlopak](https://togithub.com/Uzlopak) - chore: use ts-benchmark instead of internal TS benchmarking [#11798](https://togithub.com/Automattic/mongoose/issues/11798) [mohammad0-0ahmad](https://togithub.com/mohammad0-0ahmad) ### [`v6.3.4`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#634--2022-05-19) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.3.3...6.3.4) \================== - fix(schema): disallow using schemas with schema-level projection with map subdocuments [#11698](https://togithub.com/Automattic/mongoose/issues/11698) - fix(document): avoid setting nested paths to null when they're undefined [#11723](https://togithub.com/Automattic/mongoose/issues/11723) - fix: allow using comment with findOneAndUpdate(), count(), `distinct()` and `hint` with `findOneAndUpdate()` [#11793](https://togithub.com/Automattic/mongoose/issues/11793) - fix(document): clean modified subpaths when setting nested path to null after modifying subpaths [#11764](https://togithub.com/Automattic/mongoose/issues/11764) - fix(types): allow calling `deleteModel()` with RegExp in TypeScript [#11812](https://togithub.com/Automattic/mongoose/issues/11812) - docs(typescript): add section on PopulatedDoc to TypeScript populate docs [#11685](https://togithub.com/Automattic/mongoose/issues/11685) ### [`v6.3.3`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#633--2022-05-09) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.3.2...6.3.3) \================== - perf: avoid leaking memory when using populate() with QueryCursor because of reusing populate options with `_docs` [#11641](https://togithub.com/Automattic/mongoose/issues/11641) - fix(types): add `_id` back for LeanDocument [#11769](https://togithub.com/Automattic/mongoose/issues/11769) [#11761](https://togithub.com/Automattic/mongoose/issues/11761) [taxilian](https://togithub.com/taxilian) - fix(model): add skipValidation option for bulkWrite() to allow skipping validation for `insertOne` and `replaceOne` [#11663](https://togithub.com/Automattic/mongoose/issues/11663) - fix(document): correctly $\__reset() subdocuments that are under nested paths [#11672](https://togithub.com/Automattic/mongoose/issues/11672) - fix(query): handle casting BSONRegExp instances as RegExps in queries [#11597](https://togithub.com/Automattic/mongoose/issues/11597) - fix: correctly cast $not in $expr [#11689](https://togithub.com/Automattic/mongoose/issues/11689) - perf: optimize size of browser bundle, use buffer v.5.7.1 package to match buffer package of mongodb in browser bundle [#11765](https://togithub.com/Automattic/mongoose/issues/11765) [Uzlopak](https://togithub.com/Uzlopak) - docs: Query.populate docs do not include using an array of strings for the path param [#11768](https://togithub.com/Automattic/mongoose/issues/11768) [#11641](https://togithub.com/Automattic/mongoose/issues/11641) [AbdelrahmanHafez](https://togithub.com/AbdelrahmanHafez) - chore: add GitHub workflow to close stale "can't reproduce", "help", "needs clarification" issues [#11753](https://togithub.com/Automattic/mongoose/issues/11753) [Uzlopak](https://togithub.com/Uzlopak) - chore: remove Makefile dependency for compiling docs [#11751](https://togithub.com/Automattic/mongoose/issues/11751) [Uzlopak](https://togithub.com/Uzlopak) ### [`v6.3.2`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#632--2022-05-02) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.3.1...6.3.2) \================== - perf: avoid registering event listeners on subdocuments to reduce memory usage [#11541](https://togithub.com/Automattic/mongoose/issues/11541) - fix(setDefaultsOnInsert): set default if sibling of nested path is $set [#11668](https://togithub.com/Automattic/mongoose/issues/11668) - perf(document): remove unnecessary workaround for ignoring subpaths of arrays [#11541](https://togithub.com/Automattic/mongoose/issues/11541) - fix(types): various fixes and improvements for types [#11650](https://togithub.com/Automattic/mongoose/issues/11650) [taxilian](https://togithub.com/taxilian) - fix(types): make mongoose typings work without esmModuleInterop true [#11695](https://togithub.com/Automattic/mongoose/issues/11695) [Uzlopak](https://togithub.com/Uzlopak) - fix(types): support populate(path, fields, model) syntax [#11649](https://togithub.com/Automattic/mongoose/issues/11649) [#11598](https://togithub.com/Automattic/mongoose/issues/11598) [mohammad0-0ahmad](https://togithub.com/mohammad0-0ahmad) - fix(types): correct SchemaTypeOptions.get function signature [#11561](https://togithub.com/Automattic/mongoose/issues/11561) - fix: fix browser build for Webpack 5 [#11717](https://togithub.com/Automattic/mongoose/issues/11717) - docs: improve readme [#11705](https://togithub.com/Automattic/mongoose/issues/11705) [mahendrap1512](https://togithub.com/mahendrap1512) ### [`v6.3.1`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#631--2022-04-21) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.3.0...6.3.1) \================== - perf: improve perf of key order [#11639](https://togithub.com/Automattic/mongoose/issues/11639) [Uzlopak](https://togithub.com/Uzlopak) - fix(timestamps): set createdAt when creating new single nested subdocuments [#11603](https://togithub.com/Automattic/mongoose/issues/11603) - fix: improve CastError message when throwing StrictModeError [#11506](https://togithub.com/Automattic/mongoose/issues/11506) - fix: upgrade bson to match mongodb@4.5 [#11676](https://togithub.com/Automattic/mongoose/issues/11676) - fix(populate): avoid populating single nested subdocs underneath arrays if there's no `ref` [#11538](https://togithub.com/Automattic/mongoose/issues/11538) - fix: handle { capped: number } in schema definition with `createCollection()` [#11539](https://togithub.com/Automattic/mongoose/issues/11539) - fix: call markModified before setting changes in Array and in DocumentArray methods [#11660](https://togithub.com/Automattic/mongoose/issues/11660) [josegl](https://togithub.com/josegl) - fix: only allow using minus path to remove auto-selected discriminatorKey from projection [#11546](https://togithub.com/Automattic/mongoose/issues/11546) - fix(types): set context on virtual getters/setters by default [#11543](https://togithub.com/Automattic/mongoose/issues/11543) - fix(types): correct return type for Connection.prototype.transaction [#9919](https://togithub.com/Automattic/mongoose/issues/9919) - fix(types): allow model as document interface key when using `extends Document` [#11629](https://togithub.com/Automattic/mongoose/issues/11629) - docs: improve populate typing [#11690](https://togithub.com/Automattic/mongoose/issues/11690) [onichandame](https://togithub.com/onichandame) - docs: add information regarding typings-tests [#11691](https://togithub.com/Automattic/mongoose/issues/11691) [Uzlopak](https://togithub.com/Uzlopak) - docs: fix jsdoc for mongoose.createConnection [#11693](https://togithub.com/Automattic/mongoose/issues/11693) [Uzlopak](https://togithub.com/Uzlopak) ### [`v6.3.0`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#630--2022-04-14) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.2.11...6.3.0) \================== - fix: upgrade mongodb driver -> 4.5.0 [#11623](https://togithub.com/Automattic/mongoose/issues/11623) [AbdelrahmanHafez](https://togithub.com/AbdelrahmanHafez) - feat(schema): allow defining discriminators on schema and in schema definition [#7971](https://togithub.com/Automattic/mongoose/issues/7971) [IslandRhythms](https://togithub.com/IslandRhythms) - feat(base): add option to set allowDiskUse globally [#11554](https://togithub.com/Automattic/mongoose/issues/11554) [AbdelrahmanHafez](https://togithub.com/AbdelrahmanHafez) - feat(schema): add `removeIndex()` and `clearIndex()` [#11547](https://togithub.com/Automattic/mongoose/issues/11547) [IslandRhythms](https://togithub.com/IslandRhythms) - feat(cursor): add `continueOnError` option to allow executing `eachAsync()` on all docs even if error occurs [#6355](https://togithub.com/Automattic/mongoose/issues/6355) - feat(query): add `versionKey` option to `lean()` for removing version key from lean docs [#8934](https://togithub.com/Automattic/mongoose/issues/8934) [IslandRhythms](https://togithub.com/IslandRhythms) - feat(types): create new ProjectionType type for select(), find(), etc. [#11437](https://togithub.com/Automattic/mongoose/issues/11437) - chore: use webpack 5 for browser build [#11584](https://togithub.com/Automattic/mongoose/issues/11584) [AbdelrahmanHafez](https://togithub.com/AbdelrahmanHafez) ### [`v6.2.11`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#6211--2022-04-13) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.2.10...6.2.11) \=================== - fix(document): handle validation with triply nested document arrays [#11564](https://togithub.com/Automattic/mongoose/issues/11564) - fix(query): skip applying string schema setters on $regex [#11426](https://togithub.com/Automattic/mongoose/issues/11426) - fix: skip findOneAndReplace() validation if runValidators = false [#11559](https://togithub.com/Automattic/mongoose/issues/11559) - fix(model): correctly handle schema-level collations in syncIndexes() [#7621](https://togithub.com/Automattic/mongoose/issues/7621) - fix(types): correct populate query return type with lean [#11560](https://togithub.com/Automattic/mongoose/issues/11560) [mohammad0-0ahmad](https://togithub.com/mohammad0-0ahmad) - fix(types): allow using { type: Mixed } as schema type definition for any path [#10900](https://togithub.com/Automattic/mongoose/issues/10900) - docs: fix example on Schema.prototype.post() [#11648](https://togithub.com/Automattic/mongoose/issues/11648) [EmilienLeroy](https://togithub.com/EmilienLeroy) - docs: fix typo in methods/index.js [#11651](https://togithub.com/Automattic/mongoose/issues/11651) [eltociear](https://togithub.com/eltociear) ### [`v6.2.10`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#6210--2022-04-04) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.2.9...6.2.10) \=================== - fix(types): improve lastErrorObject typing for rawResults [#11602](https://togithub.com/Automattic/mongoose/issues/11602) [simllll](https://togithub.com/simllll) - docs(typescript): add note about deprecating extends Document [#11619](https://togithub.com/Automattic/mongoose/issues/11619) [AbdelrahmanHafez](https://togithub.com/AbdelrahmanHafez) - docs: consistent syntax highlighting with upgraded highlight.js [#11579](https://togithub.com/Automattic/mongoose/issues/11579) [AbdelrahmanHafez](https://togithub.com/AbdelrahmanHafez) ### [`v6.2.9`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#629--2022-03-28) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.2.8...6.2.9) \================== - perf(document+model): make a few small optimizations [#11380](https://togithub.com/Automattic/mongoose/issues/11380) - fix(types): improve populate return type [#11560](https://togithub.com/Automattic/mongoose/issues/11560) [mohammad0-0ahmad](https://togithub.com/mohammad0-0ahmad) - fix(document): avoid marking paths as modified on subdocument defaults [#11528](https://togithub.com/Automattic/mongoose/issues/11528) - docs(schema): add example to index `expires` option [#11557](https://togithub.com/Automattic/mongoose/issues/11557) [boly38](https://togithub.com/boly38) - docs(model): add change stream docs [#11275](https://togithub.com/Automattic/mongoose/issues/11275) - docs(lambda): update Lambda docs for Mongoose 6 [#11275](https://togithub.com/Automattic/mongoose/issues/11275) - docs(connections): add note about connecting with X509 [#11333](https://togithub.com/Automattic/mongoose/issues/11333) - docs(populate): fix incorrect path name in `refPath` example [#11565](https://togithub.com/Automattic/mongoose/issues/11565) [chandiwalaaadhar](https://togithub.com/chandiwalaaadhar) ### [`v6.2.8`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#628--2022-03-22) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.2.7...6.2.8) \================== - fix(document): handle casting array of spread docs [#11522](https://togithub.com/Automattic/mongoose/issues/11522) - fix(document): avoid setting nested properties on top-level document when initing with strict: false [#11526](https://togithub.com/Automattic/mongoose/issues/11526) - fix(document): correctly handle deeply nested subdocuments when getting paths to validate [#11501](https://togithub.com/Automattic/mongoose/issues/11501) - fix(types): avoid making TInstanceMethods any by default leading to `this = any` in middleware [#11435](https://togithub.com/Automattic/mongoose/issues/11435) - fix(types): allow defining array default if using Types.Array<> in document interface [#11391](https://togithub.com/Automattic/mongoose/issues/11391) - docs(migrating_to\_6): describe breaking change in Mongoose 6 about default query populate model [#11289](https://togithub.com/Automattic/mongoose/issues/11289) - docs(middleware): fix typo [#11537](https://togithub.com/Automattic/mongoose/issues/11537) [x1489](https://togithub.com/x1489) ### [`v6.2.7`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#627--2022-03-16) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.2.6...6.2.7) \================== - perf(document): avoid running validation on every array element if there's no validators to run [#11380](https://togithub.com/Automattic/mongoose/issues/11380) - fix(cursor): correctly populate in batches when batchSize is set [#11509](https://togithub.com/Automattic/mongoose/issues/11509) - fix(connection): avoid setting MongoClient on useDb() connections until after setting on base connection [#11445](https://togithub.com/Automattic/mongoose/issues/11445) - fix(schema): throw more helpful error when using schema from a different version of Mongoose module [#10453](https://togithub.com/Automattic/mongoose/issues/10453) - fix: add missing timeseries expiration handling [#11489](https://togithub.com/Automattic/mongoose/issues/11489) [#11229](https://togithub.com/Automattic/mongoose/issues/11229) [Uzlopak](https://togithub.com/Uzlopak) - docs: correct Model.findOneAndReplace docs param naming [#11524](https://togithub.com/Automattic/mongoose/issues/11524) [anatolykopyl](https://togithub.com/anatolykopyl) ### [`v6.2.6`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#626--2022-03-11) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.2.5...6.2.6) \================== - fix(types): correct reference to cursor TypeScript bindings [#11513](https://togithub.com/Automattic/mongoose/issues/11513) [SimonHausdorf](https://togithub.com/SimonHausdorf) - fix(types): allow calling Query.prototype.populate() with array of strings [#11518](https://togithub.com/Automattic/mongoose/issues/11518) - fix(types): export and refactor types of PreMiddlewareFunction, PreSaveMiddlewareFunction, PostMiddlewareFunction, ErrorHandlingMiddlewareFunction [#11485](https://togithub.com/Automattic/mongoose/issues/11485) [Uzlopak](https://togithub.com/Uzlopak) ### [`v6.2.5`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#625--2022-03-09) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.2.4...6.2.5) \================== - fix(mongoose): add isObjectIdOrHexString() to better capture the most common use case for `isValidObjectId()` [#11419](https://togithub.com/Automattic/mongoose/issues/11419) - fix(query): prevent modifying discriminator key in updates using operators other than `$set` [#11456](https://togithub.com/Automattic/mongoose/issues/11456) - fix(populate+types): call foreignField functions with doc as 1st param, better typings for `localField` and `foreignField` functions [#11321](https://togithub.com/Automattic/mongoose/issues/11321) - fix(populate): return an array when using populate count on an array localField [#11307](https://togithub.com/Automattic/mongoose/issues/11307) - fix(query): avoid error when using $not with arrays [#11467](https://togithub.com/Automattic/mongoose/issues/11467) - perf: only deep clone validators if necessary [#11412](https://togithub.com/Automattic/mongoose/issues/11412) [Uzlopak](https://togithub.com/Uzlopak) - fix(types): rename definition files to lowercase to avoid typescript bug [#11469](https://togithub.com/Automattic/mongoose/issues/11469) - fix(types): aggregate.sort() accepts a string but also `{ field: 'asc'|'ascending'|'desc'|'descending' }` [#11479](https://togithub.com/Automattic/mongoose/issues/11479) [simonbrunel](https://togithub.com/simonbrunel) - fix(types): extract and refactor aggregationcursor and querycursor [#11488](https://togithub.com/Automattic/mongoose/issues/11488) [Uzlopak](https://togithub.com/Uzlopak) - fix(types): extract and refactor schemaoptions [#11484](https://togithub.com/Automattic/mongoose/issues/11484) [Uzlopak](https://togithub.com/Uzlopak) - fix(types): make first param to `Query.prototype.populate()` a string [#11475](https://togithub.com/Automattic/mongoose/issues/11475) [minhthinhls](https://togithub.com/minhthinhls) - fix(types): improve type checking for doc arrays in schema definitions [#11241](https://togithub.com/Automattic/mongoose/issues/11241) - docs: fix length comparaison in lean.test.js [#11493](https://togithub.com/Automattic/mongoose/issues/11493) [zazapeta](https://togithub.com/zazapeta) - docs(timestamps): fix typo [#11481](https://togithub.com/Automattic/mongoose/issues/11481) [saibbyweb](https://togithub.com/saibbyweb) - docs: fix broken link to rawResult [#11459](https://togithub.com/Automattic/mongoose/issues/11459) [chhiring90](https://togithub.com/chhiring90) ### [`v6.2.4`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#624--2022-02-28) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.2.3...6.2.4) \================== - fix(query): correctly return full deleteOne(), deleteMany() result [#11211](https://togithub.com/Automattic/mongoose/issues/11211) - fix(query): handle update validators on deeply nested subdocuments [#11455](https://togithub.com/Automattic/mongoose/issues/11455) [#11394](https://togithub.com/Automattic/mongoose/issues/11394) - fix(discriminator): handle modifying multiple nested paths underneath a discriminator [#11428](https://togithub.com/Automattic/mongoose/issues/11428) - perf: improve isAsyncFunction [#11408](https://togithub.com/Automattic/mongoose/issues/11408) [Uzlopak](https://togithub.com/Uzlopak) - fix(index.d.ts): add typedefs for Schema `pick()` [#11448](https://togithub.com/Automattic/mongoose/issues/11448) [Moisei-Shkil](https://togithub.com/Moisei-Shkil) - fix(index.d.ts): allow type override for distinct() [#11306](https://togithub.com/Automattic/mongoose/issues/11306) - fix(index.d.ts): allow array of validators in schema definition [#11355](https://togithub.com/Automattic/mongoose/issues/11355) - fix(index.d.ts): improve connection typings [#11418](https://togithub.com/Automattic/mongoose/issues/11418) [Uzlopak](https://togithub.com/Uzlopak) - docs: add timestamps docs [#11336](https://togithub.com/Automattic/mongoose/issues/11336) - docs(timestamps): explain how timestamps works under the hood [#11336](https://togithub.com/Automattic/mongoose/issues/11336) - docs(migrating_to\_6): add model.exists breaking change returning doument instead of boolean [#11407](https://togithub.com/Automattic/mongoose/issues/11407) [AbdelrahmanHafez](https://togithub.com/AbdelrahmanHafez) - docs(index.d.ts): add docs for FilterQuery, UpdateQuery, and LeanDocument [#11457](https://togithub.com/Automattic/mongoose/issues/11457) [Moisei-Shkil](https://togithub.com/Moisei-Shkil) ### [`v6.2.3`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#623--2022-02-21) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.2.2...6.2.3) \================== - fix(model): avoid dropping base model indexes when using discriminators with `Connection.prototype.syncIndexes()` [#11424](https://togithub.com/Automattic/mongoose/issues/11424) [#11421](https://togithub.com/Automattic/mongoose/issues/11421) [AbdelrahmanHafez](https://togithub.com/AbdelrahmanHafez) - fix(document): handle array defaults when selecting element underneath array [#11376](https://togithub.com/Automattic/mongoose/issues/11376) - fix(populate): correctly handle depopulating populated subdocuments [#11436](https://togithub.com/Automattic/mongoose/issues/11436) - fix(utils): improve deepEqual() handling for comparing objects with non-objects [#11417](https://togithub.com/Automattic/mongoose/issues/11417) - fix(schema): allow declaring array of arrays using `[{ type: [String] }]` [#11252](https://togithub.com/Automattic/mongoose/issues/11252) - perf: improve validation sync and async by replacing forEach with classic for loops [#11414](https://togithub.com/Automattic/mongoose/issues/11414) [Uzlopak](https://togithub.com/Uzlopak) - perf: make hasDollarKeys faster [#11401](https://togithub.com/Automattic/mongoose/issues/11401) [Uzlopak](https://togithub.com/Uzlopak) - fix(index.d.ts): ValidationError `errors` only contains CastError or ValidationError [#11369](https://togithub.com/Automattic/mongoose/issues/11369) [Uzlopak](https://togithub.com/Uzlopak) - fix(index.d.ts): make InsertManyResult.insertedIds return an array of Types.ObjectId by default [#11197](https://togithub.com/Automattic/mongoose/issues/11197) - fix(index.d.ts): allow pre('save') middleware with pre options [#11257](https://togithub.com/Automattic/mongoose/issues/11257) - fix(index.d.ts): add `supressReservedKeysWarning` option to schema [#11439](https://togithub.com/Automattic/mongoose/issues/11439) [hiukky](https://togithub.com/hiukky) - docs(connections): improve replica set hostname docs with correct error message and info about `err.reason.servers` [#11200](https://togithub.com/Automattic/mongoose/issues/11200) - docs(populate): add virtual populate match option documentation [#11411](https://togithub.com/Automattic/mongoose/issues/11411) [remirobichet](https://togithub.com/remirobichet) - docs(document): add note to API docs that flattenMaps defaults to `true` for `toJSON()` but not `toObject()` [#11213](https://togithub.com/Automattic/mongoose/issues/11213) - docs(document+model): add populate option to populate() API docs [#11170](https://togithub.com/Automattic/mongoose/issues/11170) - docs(migrating_to\_6): add additional info about removing omitUndefined [#11038](https://togithub.com/Automattic/mongoose/issues/11038) - docs(migrating_to\_6): add model.exists breaking change returning doument instead of boolean [AbdelrahmanHafez](https://togithub.com/AbdelrahmanHafez) ### [`v6.2.2`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#622--2022-02-16) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.2.1...6.2.2) \================== - fix: fix QueryCursor and AggregationCursor compatibility with Node v17.5 [#11381](https://togithub.com/Automattic/mongoose/issues/11381) [benjamingr](https://togithub.com/benjamingr) - fix: better esm support, no necessity for setting allowSyntheticDefaultImports and esModuleInterop [#11343](https://togithub.com/Automattic/mongoose/issues/11343) [Uzlopak](https://togithub.com/Uzlopak) - fix(model): apply projection parameter to hydrate() [#11375](https://togithub.com/Automattic/mongoose/issues/11375) - fix: fix issue with creating arrays of length > 10000 [#11405](https://togithub.com/Automattic/mongoose/issues/11405) [Uzlopak](https://togithub.com/Uzlopak) - fix(document): minimize single nested subdocs [#11247](https://togithub.com/Automattic/mongoose/issues/11247) - fix(connection): handle reopening base connection with useDb() [#11240](https://togithub.com/Automattic/mongoose/issues/11240) - perf: use property access instead of `get()` helper where possible [#11389](https://togithub.com/Automattic/mongoose/issues/11389) [Uzlopak](https://togithub.com/Uzlopak) - fix: use `isArray()` instead of `instanceof Array` [#11393](https://togithub.com/Automattic/mongoose/issues/11393) [Uzlopak](https://togithub.com/Uzlopak) - perf: improve performance of `cast$expr()` [#11388](https://togithub.com/Automattic/mongoose/issues/11388) [Uzlopak](https://togithub.com/Uzlopak) - perf: remove `startsWith()` from `isOperator()` [#11400](https://togithub.com/Automattic/mongoose/issues/11400) [Uzlopak](https://togithub.com/Uzlopak) - fix(index.d.ts): extract `PipelineStage` into separate file [#11368](https://togithub.com/Automattic/mongoose/issues/11368) [Uzlopak](https://togithub.com/Uzlopak) - fix(index.d.ts): fix $search highlight path option type [#11373](https://togithub.com/Automattic/mongoose/issues/11373) [lmX2015](https://togithub.com/lmX2015) - docs: update changelog file to CHANGELOG.md [#11365](https://togithub.com/Automattic/mongoose/issues/11365) [AbdelrahmanHafez](https://togithub.com/AbdelrahmanHafez) - docs: fix broken links [#11388](https://togithub.com/Automattic/mongoose/issues/11388) [#11377](https://togithub.com/Automattic/mongoose/issues/11377) [saibbyweb](https://togithub.com/saibbyweb) - docs: remove double determiners in connections docs [#11340](https://togithub.com/Automattic/mongoose/issues/11340) [Erma32](https://togithub.com/Erma32) ### [`v6.2.1`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#6211--2022-04-13) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.2.0...6.2.1) \=================== - fix(document): handle validation with triply nested document arrays [#11564](https://togithub.com/Automattic/mongoose/issues/11564) - fix(query): skip applying string schema setters on $regex [#11426](https://togithub.com/Automattic/mongoose/issues/11426) - fix: skip findOneAndReplace() validation if runValidators = false [#11559](https://togithub.com/Automattic/mongoose/issues/11559) - fix(model): correctly handle schema-level collations in syncIndexes() [#7621](https://togithub.com/Automattic/mongoose/issues/7621) - fix(types): correct populate query return type with lean [#11560](https://togithub.com/Automattic/mongoose/issues/11560) [mohammad0-0ahmad](https://togithub.com/mohammad0-0ahmad) - fix(types): allow using { type: Mixed } as schema type definition for any path [#10900](https://togithub.com/Automattic/mongoose/issues/10900) - docs: fix example on Schema.prototype.post() [#11648](https://togithub.com/Automattic/mongoose/issues/11648) [EmilienLeroy](https://togithub.com/EmilienLeroy) - docs: fix typo in methods/index.js [#11651](https://togithub.com/Automattic/mongoose/issues/11651) [eltociear](https://togithub.com/eltociear) ### [`v6.2.0`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#620--2022-02-02) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.1.10...6.2.0) \================== - feat: upgrade MongoDB driver to 4.3.1 - feat(connection+mongoose): add support for continueOnError for syncIndexes [#11266](https://togithub.com/Automattic/mongoose/issues/11266) [AbdelrahmanHafez](https://togithub.com/AbdelrahmanHafez) - feat(query): cast literals in `$expr` where possible [#10663](https://togithub.com/Automattic/mongoose/issues/10663) - feat(schema+mongoose): add pluginTags to allow applying global plugins to only schemas with matching tags [#9780](https://togithub.com/Automattic/mongoose/issues/9780) - feat(discriminator): support overwriteModels:true to reuse discriminator names [#11244](https://togithub.com/Automattic/mongoose/issues/11244) [#10931](https://togithub.com/Automattic/mongoose/issues/10931) [IslandRhythms](https://togithub.com/IslandRhythms) - feat(index.d.ts): add DocType generic param to Model functions that return queries to better support projections [#11156](https://togithub.com/Automattic/mongoose/issues/11156) - feat(error): export MongooseServerSelectionError [#11202](https://togithub.com/Automattic/mongoose/issues/11202) - feat(schematype): add validators, path, isRequired to public API and TypeScript types [#11139](https://togithub.com/Automattic/mongoose/issues/11139) - fix(model): make exists(...) return lean document with \_id or null instead of boolean [#11142](https://togithub.com/Automattic/mongoose/issues/11142) [AbdelrahmanHafez](https://togithub.com/AbdelrahmanHafez) - fix(model): support storing versionKey in nested paths [#10980](https://togithub.com/Automattic/mongoose/issues/10980) - fix(index.d.ts): add options to `bulkSave()` type def [#11201](https://togithub.com/Automattic/mongoose/issues/11201) [Uzlopak](https://togithub.com/Uzlopak) - fix(index.d.ts): better support for query projections [#11210](https://togithub.com/Automattic/mongoose/issues/11210) [EugeneKorshenko](https://togithub.com/EugeneKorshenko) ### [`v6.1.10`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#6110--2022-02-01) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.1.9...6.1.10) \=================== - fix(mongoose): correctly handle destructured isValidObjectId [#11304](https://togithub.com/Automattic/mongoose/issues/11304) - fix(mongoose): defer to MongoDB driver isValid() for `isValidObjectId()` [#11227](https://togithub.com/Automattic/mongoose/issues/11227) ### [`v6.1.9`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#619--2022-01-31) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.1.8...6.1.9) \================== - fix(query): respect nested schema strict as default when casting query filters [#11291](https://togithub.com/Automattic/mongoose/issues/11291) - fix(mongoose): make isValidObjectId() consistent with isValid(), make `ObjectId()` casting more flexible [#11209](https://togithub.com/Automattic/mongoose/issues/11209) - fix(setDefaultsOnInsert): ignore defaults underneath maps [#11235](https://togithub.com/Automattic/mongoose/issues/11235) - fix(query): avoid setting nested schema properties that are stripped out by strictQuery to undefined in query filter [#11291](https://togithub.com/Automattic/mongoose/issues/11291) - fix: check for all flags in a regex deepequal [#11242](https://togithub.com/Automattic/mongoose/issues/11242) [Uzlopak](https://togithub.com/Uzlopak) - fix: replace substr with substring [#11278](https://togithub.com/Automattic/mongoose/issues/11278) [Uzlopak](https://togithub.com/Uzlopak) - docs: port for documentation testing in CONTRIBUTING.md [#11273](https://togithub.com/Automattic/mongoose/issues/11273) [Uzlopak](https://togithub.com/Uzlopak) ### [`v6.1.8`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#618--2022-01-24) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.1.7...6.1.8) \================== - fix(connection): stop leaking sessions in .transaction() [#11259](https://togithub.com/Automattic/mongoose/issues/11259) [#11256](https://togithub.com/Automattic/mongoose/issues/11256) [Uzlopak](https://togithub.com/Uzlopak) - perf: remove sliced in favor of Array.prototype.slice() [#11238](https://togithub.com/Automattic/mongoose/issues/11238) [Uzlopak](https://togithub.com/Uzlopak) - perf: improve setDottedPath [#11264](https://togithub.com/Automattic/mongoose/issues/11264) [Uzlopak](https://togithub.com/Uzlopak) - fix(document): handle edge case where NestJS sets String.type = String, mixing up schema definitions [#11199](https://togithub.com/Automattic/mongoose/issues/11199) - fix: remove obsolete code after upgrading to bson4 [#11265](https://togithub.com/Automattic/mongoose/issues/11265) [Uzlopak](https://togithub.com/Uzlopak) - fix: remove util.isArray in favor of Array.isArray [#11234](https://togithub.com/Automattic/mongoose/issues/11234) [Uzlopak](https://togithub.com/Uzlopak) - fix(index.d.ts): avoid UnpackedIntersection making `findOne().populate()` result non-nullable [#11041](https://togithub.com/Automattic/mongoose/issues/11041) - docs(migration): add note to change default functions to schema [#11245](https://togithub.com/Automattic/mongoose/issues/11245) [AbdelrahmanHafez](https://togithub.com/AbdelrahmanHafez) - docs: updated docs and issue templates for new FAQs [#11171](https://togithub.com/Automattic/mongoose/issues/11171) [IslandRhythms](https://togithub.com/IslandRhythms) - chore: fix casting benchmark [#11262](https://togithub.com/Automattic/mongoose/issues/11262) [Uzlopak](https://togithub.com/Uzlopak) - chore: add mongodb-memory-server to test easier locally [#11255](https://togithub.com/Automattic/mongoose/issues/11255) [Uzlopak](https://togithub.com/Uzlopak) - chore: fix testing tsconfig [#11243](https://togithub.com/Automattic/mongoose/issues/11243) [Uzlopak](https://togithub.com/Uzlopak) - refactor: move utils.random to test folder [#11239](https://togithub.com/Automattic/mongoose/issues/11239) [Uzlopak](https://togithub.com/Uzlopak) ### [`v6.1.7`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#617--2022-01-17) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.1.6...6.1.7) \================== - fix(model): correct handling for $push on a nested array [#11108](https://togithub.com/Automattic/mongoose/issues/11108) - fix(update): correctly apply timestamps to update pipelines [#11151](https://togithub.com/Automattic/mongoose/issues/11151) - fix(document): correctly handle modifying array subdocument after setting array subdocument to itself [#11172](https://togithub.com/Automattic/mongoose/issues/11172) - fix(index.d.ts): allow passing options to model() in place of removed `skipInit` [#11137](https://togithub.com/Automattic/mongoose/issues/11137) - fix(aggregate): allow passing verbosity to Aggregate.prototype.explain() [#11144](https://togithub.com/Automattic/mongoose/issues/11144) - fix(index.d.ts): avoid TypeScript inferring \_id as any type with HydratedDocument [#11085](https://togithub.com/Automattic/mongoose/issues/11085) - docs: fix Node.js Driver compat link [#11214](https://togithub.com/Automattic/mongoose/issues/11214) [wesbos](https://togithub.com/wesbos) - docs: remove extraneous backquote [#11204](https://togithub.com/Automattic/mongoose/issues/11204) [joebowbeer](https://togithub.com/joebowbeer) ### [`v6.1.6`](https://togithub.com/Automattic/mongoose/blob/HEAD/CHANGELOG.md#616--2022-01-10) [Compare Source](https://togithub.com/Automattic/mongoose/compare/6.1.5...6.1.6) \================== - perf(document): delay creating document event emitter until used to improve memory usage, several small improvements to improve initing docs with large arrays [#10400](https://togithub.com/Automattic/mongoose/issues/10400) - fix(model): avoid `bulkSave()` error when `versionKey: false` [#11186](https://togithub.com/Automattic/mongoose/issues/11186) [#11071](https://togithub.com/Automattic/mongoose/issues/11071) [IslandRhythms](https://togithub.com/IslandRhythms) - fix(model): revert [#11079](https://togithub.com/Automattic/mongoose/issues/11079): `findByIdAndUpdate(undefined)` breaking change [#11149](https://togithub.com/Automattic/mongoose/issues/11149) - fix(index.d.ts): support strings in deep populate [#11181](https://togithub.com/Automattic/mongoose/issues/11181) [ivalduan](https://togithub.com/ivalduan) - fix(index.d.ts): rename map() -> transform() to line up with change in v6.0 [#11161](https://togithub.com/Automattic/mongoose/issues/11161) - fix(index.d.ts): allow new ModelConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), 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 these updates again.
This PR has been generated by Mend Renovate. View repository job log here.