Repository navigation
Releases
Releases · Automattic/mongoose
9.13.0
9.13.0 / 2026-11-23
- feat: upgrade MongoDB driver to 7.9 #16724 oscarmaia
- feat(schema+model+query): add defaultSort option to schemas, applies default sort to all queries unless sort explicitly specified #16676 #16577
- perf(documentArray): avoid O(n*m) id() lookup when setting a documentarray to a plain array #16683 #16673
- perf(subdocument): check isNew before isDirectModified() in markModified() #16743 g4lb
- fix: make ducktyping more rigorous about inherited vs own properties, fix a few cases where user-specified
$__and$__isNestedcaused confusing errors #16723 - types: handle nested projections in typescript #16678
- docs(mongoose): document the mongoose.mongo property #16712 #16710 VaibhavBajpaij
8.24.11
9.12.3
9.12.3 / 2026-11-20
- fix(model): match pathsToSkip string paths exactly in Model.validate() #16706 NotAFlightRisk
- fix(query): avoid casting $expr $in search value when it is an expression #16709 kwy404
- fix(update): run update validators on mixed paths in subdocuments #16708 #16707 lazerg
- fix(documentarray): respect castNonArrays path option on document arrays #16685 yxshee
- types(schema): add removeVirtual() to Schema #16722 farisbasha
- docs(document): correct checkKeys default for save() #16716 phatstraws
- docs: fix typos in comments, tests, and typings #16714 ninglinLiu
9.12.2
9.12.2 / 2026-11-16
- fix(query): make sanitizeFilter catch any fields that start with $ in top-level filter to avoid bypass using $_internalSchemaXor and other MongoDB internal expressions
- fix(query): hardening for sanitizeProjection
- fix(array): avoid converting BigInts to numbers in addToSet() #16693 luantaraschi
- fix(cursor): propagate error passed to destroy() without re-emitting if error already emitted #16686 #16610 #16609 IbrahimHafez1
- fix(query): throw cast errors and respect strict option in replaceOne() #16629 #16628 OmBhandwaldar
- fix(castArrayFilters): cast $and/$or/$nor wherever they appear in an array filter #16638 #16637 mtechcave1
- fix(document): allow setting dotted paths 3+ levels deep underneath single nested subdocuments #16691 RagedPanda
- fix(connection): reset document state before retrying after a transient commit error #16640 #16639 IbrahimHafez1
- fix(array): avoid converting BigInts to numbers in addToSet() #16693 luantaraschi
- docs: add EOL date for Mongoose 7 #16719
- docs(mongoose): document missing options for set() #16703 ragib-mrb
8.24.10
8.24.9
8.24.9 / 2026-11-12
- fix(document): allow setting dotted paths 3+ levels deep underneath single nested subdocuments #16691 RagedPanda
- fix(connection): don't disable autoIndex/autoCreate for a primary ReadPreference instance mrityunjay-pandey
9.12.1
9.12.1 / 2026-11-09
- perf(update): avoid quadratic ancestor lookup in update validators and validate nested array subdocs once #16586 https://github.com/Re-cool
- perf: keep lib/ source within Latin-1 #16681 orgads
- perf(map): avoid quadratic concat() when creating a MongooseMap from an object #16677 ptweezy
- fix(array): keep earlier pushed values when push() is called again with $each #16619 #16618 maxymlyskov
- fix(model+query): handle inherited read preference and read concern on cloned queries #16668 #16632
- fix(timestamps): set timestamps on subdocs pushed via array filters #16615 #8809 vaidehi-snk
- fix(model): validate paths under a nested path passed to Model.validate() #16653 NotAFlightRisk
- fix(update): skip array-level validators for $pull with $in #16666 AnkitKumar61
- fix(cursor): finish destruction after terminal initialization #16612 IbrahimHafez1
9.12.0
9.12.0 / 2026-11-04
- feat: upgrade to mongodb driver 7.8 #16772 #16667
- perf: improve for document arrays: cache paths with defaults and schemas with select paths; avoid unnecessary $isModified() lookup #16595
- fix: make recompileSchema recompute derived caches and delay _preCompile() until an actual model is compiled (not subdocs or doc arrays) #16595
- fix(array): compare UUIDs by value in indexOf() so pull() and addToSet() work #16606 luantaraschi
- docs(query): remove unused use$geoWithin docs and property #16589 #16583
8.24.8
8.24.8 / 2026-11-02
- fix(schema): remove map paths cleanly, including maps under nested paths (backport to 8.x) #16625 #16461 #16457 mrityunjay-pandey
- fix(schema): keep the map value schematype a single object when cloning (backport to 8.x) #16624 #16473 mrityunjay-pandey
- fix(map): support ObjectId keys in MongooseMap#has() (backport to 8.x #16634 mrityunjay-pandey
- fix(hydration): use the doc model for looking up a ref (backport to 8.x) #16623 #16453 mrityunjay-pandey
- fix(document): replace {MODEL} in custom cast error messages from document validation (backport to 8.x) #16622 #16480 mrityunjay-pandey
- fix(schema): run setters declared on the union path itself (backport to 8.x) #16621 #16528 mrityunjay-pandey
9.11.4
9.11.4 / 2026-10-23
- fix: avoid walking into inherited properties like
toStringwhen hydrating documents, setting dotted paths, and merging updates - fix: only use own properties when looking up discriminators by key
- fix(schema): disallow setting special properties via virtual()
- fix(query): respect connection-level sanitizeFilter in queries
- fix(query): disallow special properties like
__proto__as paths in where() and mod() - fix(deps): upgrade mquery -> 6.0.1 to avoid prototype pollution with query helpers like gt() and in()