Releases: Automattic/mongoose
Releases · Automattic/mongoose
8.23.1
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
9.5.0 / 2026-04-20
- feat(debug): add
timestampoption to debug output #16216 rejunp - feat(query): add
cloneUpdateoption to explicitly disable update cloning #16230 #16202 - feat(query): extend
defaultsquery option tofind()#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$setproperty 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
ObjectParameterErrorininsertOne()if doc is not an object #16221 IshitaSingh0822 - fix(cast): preserve reason in
CastErrormessage aftersetModel()#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
9.4.0
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
idto 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
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
9.3.2 / 2026-03-23
- fix(mongoose): throw error when trying to set null or undefined as options #16130 #16140
- fix(cast): include array value in query filter error message #16127 White-Devil2839
- fix(cast): replace assert.ok with descriptive Error in castNumber #16110 mrsandy1965
- fix(connection): standardize throw new Error to MongooseError #16142 techcodie
- fix(query): use MongooseError instead of Error #16132 ace-tk
- docs: add production environment example for autoIndex #16151 mrsandy1965
- docs: upgrade self-referencing http:// links to https:// #16150 mrsandy1965
- docs: fix incorrect Double cast comment and upgrade insecure plugin link #16148 mrsandy1965
- docs: fix redundant text and http link in installation section #16146 Puxhkar
- docs: fix typo 'mutiple' → 'multiple' in queries.md #16147 mrsandy1965
- docs: use HTTPS for external links in docs navigation #16133 ace-tk
- docs: use HTTPS for external links in CONTRIBUTING and homepage #16134 ace-tk
- docs(populate): replace removed mapReduce() API link #16135 ace-tk
- docs(models): replace removed count() and mapReduce() references #16123 White-Devil2839
- docs: fix broken count() and update() links in queries docs White-Devil2839
- docs: fix broken update() link in validation docs #16121 White-Devil2839
- docs: update GitHub link to use https #16120 White-Devil2839
- docs(documents): fix incorrect variable name in nullish coalescing example #16119 White-Devil2839
- docs: fix missing quotes in populate path examples #16118 White-Devil2839
- docs: fix missing comma in populate dynamic ref example #16117 White-Devil2839
- docs: clarify that transaction rollback marks fields as modified to allow re-saving #16112 ramanverse
9.3.1
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
thiscontext 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
HydratedDocTypeinautoTypedVirtuals#16083 - types(plugin): allow passing model with custom TStatics into
Schema.prototype.plugin()#16090 #16086 - chore: use
MongooseErrorinstead ofErrorin schema, model, and aggregate #15995 mahmoodhamdi - docs(projection): clean up jsdoc for
parseProjection()
9.3.0
9.3.0 / 2026-03-10
- feat(schema): support
discriminatorsoption inline for better TypeScript support #16053 - feat(aggregate): add
pipelineForUnionWith()helper to allow reusing pipelines with$unionWithin 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()andDocument#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
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
@returnsdeclarations #16036 #16018 - docs(field-level-encryption): improve CSFLE docs with model registration guidance and schema definition example #16065 #16015