Skip to content

Releases: Automattic/mongoose

8.23.1

23 Apr 14:57

Choose a tag to compare

8.23.1 / 2026-04-23

  • fix(model): support sort option in Model.bulkWrite() updateOne and replaceOne operations #16091 #16079
  • fix(setDefaultsOnInsert): check child filter paths before applying defaults (backport #16031 to 8.x) #16219 marklai1998
  • fix(schema): always pass raw string value to error validators, only trim to 30 chars for maxlength validator #16238 #16236 #15550 #15571

9.5.0

20 Apr 16:55

Choose a tag to compare

9.5.0 / 2026-04-20

  • feat(debug): add timestamp option to debug output #16216 rejunp
  • feat(query): add cloneUpdate option to explicitly disable update cloning #16230 #16202
  • feat(query): extend defaults query option to find() #16226 sderrow
  • fix(query): avoid cloning update until absolutely necessary to better support updates with __proto__ #16230 #16202
  • fix(query): avoid treating documents with a $set() method as objects with a $set property when casting updates #16230
  • fix(queryHelpers): pass default options to discriminators #16227 #16226
  • fix(document): handle including and excluding nested paths with optimistic concurrency #16177 #16054
  • fix(model): throw ObjectParameterError in insertOne() if doc is not an object #16221 IshitaSingh0822
  • fix(cast): preserve reason in CastError message after setModel() #16167 White-Devil2839
  • perf(model): remove unnecessary clone in findOneAndUpdate() #16230
  • perf: use kareem 3.3.0 mongoosejs/kareem#45 #16229
  • chore: use TSTyche assertions #16222 mrazauskas

9.4.1

03 Apr 19:02

Choose a tag to compare

9.4.1 / 2026-04-03

  • Revert "fix(setDefaultsOnInsert): run setters on default values during upsert" #16218 #16051

9.4.0

03 Apr 18:33

Choose a tag to compare

9.4.0 / 2026-04-03

  • perf(document+model): avoid parallel save error instantiation, simplify resetting atomics, streamline validation and collection handling
  • feat(document): add $getChanges() alias, deprecate getChanges() #15959 techcodie
  • fix(schema): support toJSONSchema on unions #16179
  • fix(schema): implement validation for Union schemas and subdocuments techcodie
  • fix(connection): snapshot Date in heartbeat handler and flush queue on recovery #16183 andreialecu
  • fix(model): use duck-typing with version check to validate the argument to useConnection() is actually a connection #16098
  • fix(setDefaultsOnInsert): run setters on default values during upsert #16051 mahmoodhamdi
  • fix(utils): properly compare Set objects in deepEqual KhanjarSingh
  • fix(utils): wrap discriminator merge check in parentheses to fix precedence Necro-Rohan
  • fix(schema): correct template literal in encryptionType error message Mridul012
  • fix(schema): correct error when unsupported query operator with number #16062
  • fix(types): make MergeType and UnpackedIntersection distributive over union types techcodie
  • types: add id to HydratedDocument virtuals by default unless explicitly set #16178
  • types(populate): use marker type to track populated vs depopulated type for perf
  • types(populate): retain populated paths in toObject() and toJSON() unless depopulate: true set #16085
  • types(query): make TypeScript error on $and with unrecognized query operator
  • chore: use TSTyche assertions mrazauskas
  • docs(connection): remove references to useUnifiedTopology and fix backtick
  • docs: fix typo 'retreiving' -> 'retrieving' in SchemaType getter JSDoc yogesh968
  • docs: fix typos around 'retrieve' in schemaType and tests ayushshukla1807
  • docs: fix typos in code comments Goldyvaiiii

9.3.3

25 Mar 17:45

Choose a tag to compare

9.3.3 / 2026-03-25

  • fix(schemaType): standardize to use MongooseError instead of plain Error #16172 VIPAX-JIT
  • types: make MergeType distributive to better support populate on models where the hydrated doc type is a union #16101 #16161
  • docs: upgrade http:// links to https:// in connections.md #16163 Puxhkar
  • docs: fix typographical, grammatical errors & documentation clarity improvements #16175 yogesh968
  • docs: clarify multi-mongos support documentation for sharded clusters

9.3.2

23 Mar 17:54

Choose a tag to compare

9.3.2 / 2026-03-23

9.3.1

17 Mar 15:59

Choose a tag to compare

9.3.1 / 2026-03-17

  • fix(model): handle passing string projection to hydrate() #16082
  • fix(model): fix bulkWrite() sorting #16079 #16080 pnkov
  • fix(QueryCursor): fix wrong this context in QueryCursor close callback #16104 techcodie
  • types(schema): infer schema options correctly for model context in statics #16046 #16102
  • types(schema): fix type definition for HydratedDocType in autoTypedVirtuals #16083
  • types(plugin): allow passing model with custom TStatics into Schema.prototype.plugin() #16090 #16086
  • chore: use MongooseError instead of Error in schema, model, and aggregate #15995 mahmoodhamdi
  • docs(projection): clean up jsdoc for parseProjection()

9.3.0

10 Mar 20:27

Choose a tag to compare

9.3.0 / 2026-03-10

  • feat(schema): support discriminators option inline for better TypeScript support #16053
  • feat(aggregate): add pipelineForUnionWith() helper to allow reusing pipelines with $unionWith in TypeScript #16033
  • feat(setDefaultsOnInsert): pass query as context to default functions #16041 #16025
  • fix: resolve deeply nested discriminator paths in arrayFilters #16072 Yatin81
  • fix(changeStream): emit ready on next tick to allow stream to initialize
  • fix(connection): handle calling watch() on disconnected connection
  • fix: remove references to mongodb option "promiseLibrary" hasezoey
  • fix(model+query): backwards compatible validateBeforeSave handling and avoid TypeError in removeUnusedArrayFilters on nullish update
  • perf(model): remove unnecessary overhead when saving new doc
  • types(InferRawDocType): fall back to using InferRawDocType instead of pulling non-raw inferred doc type if EnforcedDocType not set #16053
  • types: add type constraints for Document#$model() and Document#model() mrazauskas
  • docs: fix broken links and update MongoDB documentation links #16037 hasezoey
  • docs(contributing): update issue tracker links to Automattic org AkaHarshit

9.2.4

04 Mar 00:06

Choose a tag to compare

9.2.4 / 2026-03-03

  • types(models): allow unknown keys in subdocs while retaining autocomplete suggestions #16048
  • types(schema): fix issues related to defining timestamps and virtuals with methods and/or statics in schema options #16052 #16046
  • docs: use lowercase primitive types in JSDoc and fix incorrect @returns declarations #16036 #16018
  • docs(field-level-encryption): improve CSFLE docs with model registration guidance and schema definition example #16065 #16015

9.2.3

26 Feb 19:36

Choose a tag to compare

9.2.3 / 2026-02-26

  • types(model): make bulkSave() correctly take array of THydratedDocumentType #16032