Skip to content

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 19, 2024

Coming soon: The Renovate bot (GitHub App) will be renamed to Mend. PRs from Renovate will soon appear from 'Mend'. Learn more here.

This PR contains the following updates:

Package Change Age Confidence
mongoose (source) ^5.10.17 -> ^8.0.0 age confidence

Release Notes

Automattic/mongoose (mongoose)

v8.18.1

Compare Source

===================

  • types: correct type inference for maps of maps #​15602
  • types(model): copy base model statics onto discriminator model #​15623 #​15600
  • types: fix types for a string of enums #​15605 ruiaraujo
  • types(SchemaOptions): disallow versionKey: true, which fails at runtime #​15606
  • docs(typescript): add example explaining how to use query helper overrides for handling lean() #​15622 #​15601
  • docs(transactions): add note about nested transactions #​15624

v8.18.0

Compare Source

===================

  • feat(schema): support for union types #​15574 #​10894
  • fix: trim long strings in minLength and maxLength error messages and display the string length #​15571 #​15550
  • types(connection+collection): make BaseCollection and BaseConnection usable as values #​15575 #​15548
  • types: remove logic that omits timestamps when virtuals, methods, etc. options set #​15577 #​12807

v8.17.2

Compare Source

===================

  • fix: avoid Model.validate() hanging when all paths fail casting #​15580 #​15579 piotracalski
  • types(document): better support for flattenObjectIds and versionKey options for toObject() and toJSON() #​15582 #​15578
  • docs: fix docs jsdoc tags and add UUID to be listed #​15585
  • docs(document): fix code sample that errors with "Cannot set properties of undefined" #​15589

v8.17.1

Compare Source

===================

v8.17.0

Compare Source

===================

v8.16.5

Compare Source

===================

  • fix(map): avoid throwing required error if saving map of primitives with required: true #​15542
  • types(model): export MongooseBulkWriteResult type #​15546
  • types(connection): add base to connection type #​15544

v8.16.4

Compare Source

===================

v8.16.3

Compare Source

===================

  • fix(document): clean modified subpaths if unsetting map #​15520 #​15519
  • fix: make DocumentArray SchemaType pass all options to embedded SchemaType #​15523
  • types: support readonly array in query.select #​15527 omermizr

v8.16.2

Compare Source

===================

  • fix(cursor): populate after hydrating in queryCursor so populated docs get parent() #​15498 #​15494
  • fix(schema): support toJSONSchema() on mixed types and improve error message about unsupported types #​15492 #​15489
  • types: add _id and __v to toObject/toJSON transform type #​15501 #​15479
  • types(schema): use user-provided THydratedDocumentType as context for virtual get() and set() #​15517 #​15516
  • types: improve typing for transform option to toJSON and toObject #​15485
  • docs: link to custom setter docs from lowercase, etc. options and note that setters run on query filters #​15493 #​15491
  • docs(jest): add note about resetModules #​15515

v8.16.1

Compare Source

===================

  • fix(document): avoid setting _skipMarkModified when setting nested path with merge option #​15484 #​11913
  • fix(model): make sure post save error handler gets doc as param on VersionError #​15483 #​15480
  • fix: consistent $conditionalHandlers setup between schematypes #​15490
  • docs(compatibility): note that mongodb 4.0 is not supported anymore since 8.16.0 #​15487 hasezoey
  • docs: remove unnecessary --save flag from npm install instruction #​15486 Thahirgeek

v8.16.0

Compare Source

===================

v8.15.2

Compare Source

===================

  • fix(document+schema): improve handling for setting paths underneath maps, including maps of maps #​15477 #​15461
  • fix: report default paths in VersionError message because they can can cause VersionError #​15464
  • fix(updateValidators): ensure update validators only call validators underneath single nested paths once #​15446 #​15436
  • fix: fix validation for deeply nested maps of subdocuments #​15469 #​15447 AbdelrahmanHafez
  • fix(DocumentArray): correctly set parent if instantiated with schema from another Mongoose instance #​15471 #​15466
  • types(model): use ProjectionType for Model.hydrate() #​15447 #​15443

v8.15.1

Compare Source

===================

v8.15.0

Compare Source

===================

v8.14.3

Compare Source

===================

v8.14.2

Compare Source

===================

  • fix(query): handle casting array filter paths underneath array filter paths with embedded discriminators #​15388 #​15386
  • docs(typescript): correct schema and model generic params in TS virtuals docs #​15391
  • docs+types(schema): add alternative optimisticConcurrency syntaxes to docs + types #​15405 #​10591
  • chore: add Node 24 to CI matrix #​15408 stscoundrel

v8.14.1

Compare Source

===================

  • fix: correct change tracking with maps of arrays of primitives and maps of maps #​15374 #​15350
  • fix(populate): consistently convert Buffer representation of UUID to hex string to avoid confusing populate assignment #​15383 #​15382
  • docs: add TypeScript Query guide with info on lean() + transform() #​15377 #​15311

v8.14.0

Compare Source

===================

v8.13.3

Compare Source

===================

v8.13.2

Compare Source

===================

  • fix: avoid double calling validators on paths in document arrays underneath subdocuments #​15338 #​15335

v8.13.1

Compare Source

===================

  • fix(populate): handle virtual populate on array of UUIDs #​15329 #​15315
  • types: allow default function returning undefined with DocType override #​15328

v8.13.0

Compare Source

===================

  • feat: bump mongodb driver -> 6.15.0
  • feat: support custom types exported from driver #​15321

v8.12.2

Compare Source

===================

  • fix(document): avoid stripping out fields in discriminator schema after select: false field #​15322 #​15308
  • fix(AggregationCursor): make next() error if schema pre('aggregate') middleware throws error #​15293 #​15279
  • fix(populate): correctly get schematypes when deep populating under a map #​15302 #​9359
  • fix(model): avoid returning null from bulkSave() if error doesn't have writeErrors property #​15323
  • types: add WithTimestamps utility type #​15318 baruchiro
  • docs: update references to the ms module in date schema documentation #​15319 baruchiro
  • docs: fix typo in schematypes.md #​15305 skyran1278

v8.12.1

Compare Source

===================

v8.12.0

Compare Source

===================

v8.11.0

Compare Source

===================

  • feat(model): make bulkWrite results include MongoDB bulk write errors as well as validation errors #​15271 #​15265
  • feat(document): add schemaFieldsOnly option to toObject() and toJSON() #​15259 #​15218
  • feat: introduce populate ordered option for populating in series rather than in parallel for transactions #​15239 #​15231 #​15210
  • fix(bigint): throw error when casting BigInt that's outside of the bounds of what MongoDB can safely store #​15230 #​15200

v8.10.2

Compare Source

===================

v8.10.1

Compare Source

===================

  • perf(document): only call undoReset() 1x/document #​15257 #​15255
  • perf(schema): clear childSchemas when overwriting existing path to avoid performance degradations #​15256 #​15253
  • perf: some more micro optimizations for find() and findOne() #​14906 #​15250
  • fix(model): avoid adding timeout on Model.init() buffering to avoid unintentional dangling open handles #​15251 #​15241
  • fix: avoid connection buffering on init if autoCreate: false #​15247 #​15241
  • fix: infer discriminator key if set in $set with overwriteDiscriminatorKey #​15243 #​15218
  • types(middleware): make this in document middleware the hydrated doc type, not raw doc type #​15246 #​15242
  • types(schema): support options parameter to Schema.prototype.discriminator() #​15249 #​15244
  • types(schema): allow calling Schema.prototype.number() with no message arg #​15237 #​15236
  • docs(typescript): recommend using HydratedSingleSubdocument over Types.Subdocument #​15240 #​15211

v8.10.0

Compare Source

===================

  • feat(schema+schematype): add toJSONSchema() method to convert schemas and schematypes to JSON schema #​15184 #​11162
  • feat(connection): make connection helpers respect bufferTimeoutMS #​15229 #​15201
  • feat(document): support schematype-level transform option #​15163 #​15084
  • feat(model): add insertOne() function to insert a single doc #​15162 #​14843
  • feat(connection): support Connection.prototype.aggregate() for db-level aggregations #​15153
  • feat(model): make syncIndexes() not call createIndex() on indexes that already exist #​15175 #​12250
  • feat(model): useConnection(connection) function #​14802
  • fix(model): disallow updateMany(update) and fix TypeScript types re: updateMany() #​15199 #​15190
  • fix(collection): avoid buffering if creating a collection during a connection interruption #​15187 #​14971
  • fix(model): throw error if calling create() with multiple docs in a transaction unless ordered: true #​15100
  • fix(model): skip createCollection() in syncIndexes() if autoCreate: false #​15155
  • fix(model): make hydrate() handle hydrating deeply nested populated docs with hydratedPopulatedDocs #​15130
  • types(document): make sure toObject() and toJSON() apply versionKey __v #​15097
  • ci(NODE-6505): CI Setup for Encryption Support #​15139 aditi-khare-mongoDB

v8.9.7

Compare Source

==================

v8.9.6

Compare Source

==================

  • fix(document): allow setting values to undefined with set(obj) syntax with strict: false #​15207 #​15192
  • fix(schema): improve reason for UUID cast error, currently a TypeError #​15215 #​15202
  • fix(aggregate): improve error when calling near() with invalid coordinates #​15206 #​15188

v8.9.5

Compare Source

==================

v8.9.4

Compare Source

==================

  • fix(document): fix document not applying manual populate when using a function in schema.options.ref #​15138 IchirokuXVI
  • fix(model): make Model.validate() static correctly cast document arrays #​15169 #​15164
  • fix(model): allow passing validateBeforeSave option to bulkSave() to skip validation #​15161 #​15156
  • fix(schema): allow multiple self-referencing discriminator schemas using Schema.prototype.discriminator #​15142 #​15120
  • types: avoid BufferToBinary<> wiping lean types when passed to generic functions #​15160 #​15158
  • docs: fix <code> in header ids #​15159
  • docs: fix header in field-level-encryption.md #​15137 damieng

v8.9.3

Compare Source

==================

  • fix(schema): make duplicate index error a warning for now to prevent blocking upgrading #​15135 #​15112 #​15109
  • fix(model): handle document array paths set to non-array values in Model.castObject() #​15124 #​15075
  • fix(document): avoid using childSchemas.path for compatibility with pre-Mongoose-8.8 schemas #​15131 #​15071
  • fix(model): avoid throwing unnecessary error if updateOne() returns null in save() #​15126
  • perf(cursor): clear the stack every time if using populate with batchSize to avoid stack overflows with large docs #​15136 #​10449
  • types: make BufferToBinary avoid Document instances #​15123 #​15122
  • types(model+query): avoid stripping out virtuals when calling populate with paths generic #​15132 #​15111
  • types(schema): add missing removeIndex #​15134
  • types: add cleanIndexes() to IndexManager interface #​15127
  • docs: move search endpoint to netlify #​15119

v8.9.2

Compare Source

==================

  • fix(schema): avoid throwing duplicate index error if index spec keys have different order or index has a custom name #​15112 #​15109
  • fix(map): clean modified subpaths when overwriting values in map of subdocs #​15114 #​15108
  • fix(aggregate): pull session from transaction local storage for aggregation cursors #​15094 IchirokuXVI
  • types: correctly handle union types in BufferToBinary and related helpers #​15103 #​15102 #​15057
  • types: add UUID to RefType #​15115 #​15101
  • docs: remove link to Mongoose 5.x docs from dropdown #​15116
  • docs(connection+document+model): remove remaining references to remove(), clarify that deleteOne() does not execute until then() or exec() #​15113 #​15107

v8.9.1

Compare Source

==================

  • fix(connection): remove heartbeat check in load balanced mode #​15089 #​15042 #​14812
  • fix(discriminator): gather childSchemas when creating discriminator to ensure $getAllSubdocs() can properly get all subdocs #​15099 #​15088 #​15092
  • fix(model): handle discriminators in castObject() #​15096 #​15075
  • fix(schema): throw error if duplicate index definition using unique in schema path and subsequent .index() call #​15093 #​15056
  • fix: mark documents that are populated using hydratedPopulatedDocs option as populated in top-level doc #​15080 #​15048
  • fix(document+schema): improve error message for get() on invalid path #​15098 #​15071
  • docs: remove more callback doc references & some small other changes #​15095

v8.9.0

Compare Source

==================

v8.8.4

Compare Source

==================

  • fix: cast using overwritten embedded discriminator key when set #​15076 #​15051
  • fix: avoid throwing error if saveOptions undefined when invalidating subdoc cache #​15062

v8.8.3

Compare Source

==================

  • fix: disallow using $where in match
  • perf: cache results from getAllSubdocs() on saveOptions, only loop through known subdoc properties #​15055 #​15029
  • fix(model+query): support overwriteDiscriminatorKey for bulkWrite updateOne and updateMany, allow inferring discriminator key from update #​15046 #​15040

v8.8.2

Compare Source

==================

  • fix(model): handle array filters when casting bulkWrite #​15036 #​14978
  • fix(model): make diffIndexes() avoid trying to drop default timeseries collection index #​15035 #​14984
  • fix: save execution stack in query as string #​15039 durran
  • types(cursor): correct asyncIterator and asyncDispose for TypeScript with lib: 'esnext' #​15038
  • docs(migrating_to_8): add note about removing findByIdAndRemove #​15024 dragontaek-lee

v8.8.1

Compare Source

==================

  • perf: make a few micro-optimizations to help speed up findOne() #​15022 #​14906
  • fix: apply embedded discriminators to subdoc schemas before compiling top level model so middleware applies correctly #​15001 #​14961
  • fix(query): add overwriteImmutable option to allow updating immutable properties without disabling strict mode #​15000 #​8619

v8.8.0

Compare Source

==================

  • feat: upgrade mongodb -> ~6.10 #​14991 #​14877
  • feat(query): add schemaLevelProjections option to query to disable schema-level select: false #​14986 #​11474
  • feat: allow defining virtuals on arrays, not just array elements #​14955 #​2326
  • feat(model): add applyTimestamps() function to apply all schema timestamps, including subdocuments, to a given POJO #​14943 #​14698
  • feat(model): add hideIndexes option to syncIndexes() and cleanIndexes() #​14987 #​14868
  • fix(query): make sanitizeFilter disable implicit $in #​14985 #​14657
  • fix(model): avoid unhandled error if createIndex() throws a sync error #​14995
  • fix(model): avoid throwing TypeError if bulkSave()'s bulkWrite() fails with a non-BulkWriteError #​14993
  • types: added toJSON:flattenObjectIds effect #​14989
  • types: add __v to lean() result type and ModifyResult #​14990 #​12959
  • types: use globalThis instead of global for NativeDate #​14992 #​14988
  • docs(change-streams): fix markdown syntax highlighting for script output example #​14994

v8.7.3

Compare Source

==================

  • fix(cursor): close underlying query cursor when calling destroy() #​14982 #​14966
  • types: add JSONSerialized helper that can convert HydratedDocument to JSON output type #​14981 #​14451
  • types(model): convert InsertManyResult to interface and remove unnecessary insertedIds override #​14977
  • types(connection): add missing sanitizeFilter option #​14975
  • types: improve goto definition for inferred schema definitions #​14968 forivall
  • docs(migration-guide-v7): correct link to the section "Id Setter" #​14973 rb-ntnx

v8.7.2

Compare Source

==================

  • fix(document): recursively clear modified subpaths when setting deeply nested subdoc to null #​14963 #​14952
  • fix(populate): handle array of ids with parent refPath #​14965
  • types: make Buffers into mongodb.Binary in lean result type to match runtime behavior #​14967
  • types: correct schema type inference when using nested typeKey like type: { type: String } [#&#8203

Configuration

📅 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 this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/mongoose-8.x branch from cd65fe1 to 05e3cfa Compare June 22, 2024 18:50
@renovate renovate bot force-pushed the renovate/mongoose-8.x branch 2 times, most recently from 05617eb to bb1e73d Compare July 30, 2025 11:29
@renovate renovate bot force-pushed the renovate/mongoose-8.x branch from bb1e73d to 56c1f17 Compare August 7, 2025 20:49
@renovate renovate bot force-pushed the renovate/mongoose-8.x branch 2 times, most recently from 11d6c5d to 85c431c Compare August 22, 2025 19:06
@renovate renovate bot force-pushed the renovate/mongoose-8.x branch from 85c431c to 671f832 Compare September 8, 2025 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants