Releases: Automattic/mongoose
Releases · Automattic/mongoose
8.6.0
8.6.0 / 2024-08-28
- feat: upgrade mongodb -> 6.8.0, handle throwing error on closed cursor in Mongoose with
MongooseError
instead ofMongoCursorExhaustedError
#14813 - feat(model+query): support options parameter for distinct() #14772 #8006
- feat(QueryCursor): add getDriverCursor() function that returns the raw driver cursor #14745
- types: change query selector to disallow unknown top-level keys by default #14764 alex-statsig
- types: make toObject() and toJSON() not generic by default to avoid type widening #14819 #12883
- types: avoid automatically inferring lean result type when assigning to explicitly typed variable #14734
8.5.5
8.5.5 / 2024-08-28
- fix(populate): fix a couple of other places where Mongoose gets the document's _id with getters #14833 #14827 #14759
- fix(discriminator): shallow clone Schema.prototype.obj before merging schemas to avoid modifying original obj #14821
- types: fix schema type based on timestamps schema options value #14829 #14825 ark23CIS
8.5.4
8.5.4 / 2024-08-23
- fix: add empty string check for collection name passed #14806 Shubham2552
- docs(model): add 'throw' as valid strict value for bulkWrite() and add some more clarification on throwOnValidationError #14809
8.5.3
8.5.3 / 2024-08-13
- fix(document): call required functions on subdocuments underneath nested paths with correct context #14801 #14788
- fix(populate): avoid throwing error when no result and
lean()
set #14799 #14794 #14759 MohOraby - fix(document): apply virtuals to subdocuments if parent schema has virtuals: true for backwards compatibility #14774 #14771 #14623 #14394
- types: make HydratedSingleSubdocument and HydratedArraySubdocument merge types instead of using & #14800 #14793
- types: support schema type inference based on schema options timestamps as well #14773 #13215 ark23CIS
- types(cursor): indicate that cursor.next() can return null #14798 #14787
- types: allow mongoose.connection.db to be undefined #14797 #14789
- docs: add schema type widening advice #14790 JstnMcBrd
8.5.2
8.5.2 / 2024-07-30
- perf(clone): avoid further unnecessary checks if cloning a primitive value #14762 #14394
- fix: allow setting document array default to null #14769 #14717 #6691
- fix(model): support session: null option for save() to opt out of automatic session option with transactionAsyncLocalStorage #14744 #14736
- fix(model+document): avoid depopulating manually populated doc as getter value #14760 #14759
- fix: correct shardkey access in buildBulkWriteOps #14753 #14752 adf0nt3s
- fix(query): handle casting $switch in $expr #14755 #14751
- types: allow calling SchemaType.cast() without parent and init parameters #14756 #14748 #9076
- docs: fix a wrong example in v6 migration guide #14758 abdelrahman-elkady
8.5.1
8.5.1 / 2024-07-12
- perf(model): performance improvements for insertMany() #14724
- fix(model): avoid leaving subdoc defaults on top-level doc when setting subdocument to same value #14728 #14722
- fix(model): handle transactionAsyncLocalStorage option with insertMany() #14743
- types: make _id required on Document type #14735 #14660
- types: fix ChangeStream.close to return a Promise like the driver #14740 orgads
8.5.0
8.5.0 / 2024-07-08
- perf: memoize toJSON / toObject default options #14672
- feat(document): add $createModifiedPathsSnapshot(), $restoreModifiedPathsSnapshot(), $clearModifiedPaths() #14699 #14268
- feat(query): make sanitizeProjection prevent projecting in paths deselected in the schema #14691
- feat: allow setting array default value to null #14717 #6691
- feat(mongoose): allow drivers to set global plugins #14682
- feat(connection): bubble up monitorCommands events to Mongoose connection if monitorCommands option set #14681 #14611
- fix(document): ensure post('deleteOne') hooks are called when calling save() after subdoc.deleteOne() #14732 #9885
- fix(query): remove count() and findOneAndRemove() from query chaining #14692 #14689
- fix: remove default connection if setting createInitialConnection to false after Mongoose instance created #14679 #8302
- types(models+query): infer return type from schema for 1-level deep nested paths #14632
- types(connection): make transaction() return type match the executor function #14661 #14656
- docs: fix docs links in index.md mirasayon
8.4.5
8.4.4
8.4.4 / 2024-06-25
- perf: avoid unnecesary get() call and use faster approach for converting to string #14673 #14394
- fix(projection): handle projections on arrays in Model.hydrate() projection option #14686 #14680
- fix(document): avoid passing validateModifiedOnly to subdocs so subdocs get fully validating if they're directly modified #14685 #14677
- fix: handle casting primitive array with $elemMatch in bulkWrite() #14687 #14678
- fix(query): cast $pull using embedded discriminator schema when discriminator key is set in filter #14676 #14675
- types(connection): fix return type of withSession() #14690 tt-public
- types: add $documents pipeline stage and fix $unionWith type #14666 nick-statsig
- docs(findoneandupdate): improve example that shows findOneAndUpdate() returning doc before updates were applied #14671 #14670
8.4.3
8.4.3 / 2024-06-17
- fix: remove 0x flamegraph files from release