Releases: Automattic/mongoose
Releases · Automattic/mongoose
7.4.4
7.4.4 / 2023-08-22
- fix(connection): reset document state in between transaction retries #13726 #13698
- fix(cursor): bubble up resumeTokenChanged event from change streams #13736 #13607
- fix(query+populate): add refPath to projection by default, unless explicitly excluded #13758
- fix(schema): support 'ascending', 'asc', 'descending', 'desc' for index direction #13761 #13725
- fix(ChangeStream): add _bindEvents to addListener function for observable support #13759 yury-ivaniutsenka
- types: infer return type when using
get()
,markModified()
, etc. with known property name literal #13739 maybesmurf - types: add missing typings for option includeResultMetadata #13747 #13746 Idnan
- types: export InferSchemaType #13737
- docs(middleware): clarify that query middleware applies to document by default #13734 #13713
- docs: add brief note on TypeScript generic usage for embedded discriminator path() calls #13728 #10435
- docs: link v7 migration guide #13742 Cooldogyum
- docs(migrating_to_6): add note about incompatible packages #13733
7.4.3
7.4.3 / 2023-08-11
- fix: avoid applying map property getters when saving #13704 #13657
- fix(query): allow deselecting discriminator key #13722 #13679
- types(models+query): return lean type when passing QueryOptions with lean: true to relevant model functions like find() and findOne() #13721 #13705
- types(schema): correct return type for Schema.prototype.indexes() #13718 #13702
- types: allow accessing options from pre middleware #13708 #13633
- types: add UpdateQueryKnownOnly type for stricter UpdateQuery type checking #13699 #13630
- types(schema): support required: { isRequired: true } syntax in schema definition #13680
- docs(middleware): clarify that doc.deleteOne() doesn't run query middleware currently #13707 #13669
7.4.2
7.4.2 / 2023-08-03
- fix(model): avoid hanging on empty bulkWrite() with ordered: false #13684 #13664
- fix: Document.prototype.isModified support for a string of keys as first parameter #13674 #13667 gastoncasini
- fix: disable id virtual if alias:id set #13654 #13650
- fix: support timestamps:false on bulkWrite with updateOne and updateMany #13649 #13611
- docs(typescript): highlight auto type inference for methods and statics, add info on using methods with generics #13696 #12942
- docs(middleware): fix old example using post('remove') #13683 #13518
- docs(deprecations): quick fix for includeResultMetadata docs #13695
7.4.1
7.4.1 / 2023-07-24
- fix(document): correctly clean up nested subdocs modified state on save() #13644 #13609
- fix(schema): avoid propagating toObject.transform and toJSON.transform option to implicitly created schemas #13634 #13599
- fix: prevent schema options overwriting user defined writeConcern #13612 #13592
- types: correctly handle pre('deleteOne', { document: true }) #13632
- types(schema): handle type: Schema.Types.Map in TypeScript #13628
- types: Add inline comment to to tell the default value of the runValidator flag in the queryOptions types #13636 omran95
- docs: rework several code examples that still use callbacks #13635 #13616
- docs: remove callbacks from validation description #13638 #13501
7.4.0
7.4.0 / 2023-07-18
- perf: speed up mapOfSubdocs benchmark by 4x by avoiding unnecessary O(n^2) loop in getPathsToValidate() #13614
- feat: upgrade to MongoDB Node.js driver 5.7.0 #13591
- feat: support generating custom cast error message with a function #13608 #3162
- feat(query): support MongoDB driver's includeResultMetadata option for findOneAndUpdate #13584 #13539
- feat(connection): add Connection.prototype.removeDb() for removing a related connection #13580 #11821
- feat(query): delay converting documents into POJOs until query execution, allow querying subdocuments with defaults disabled #13522
- feat(model): add option "aggregateErrors" for create() #13544 hasezoey
- feat(schema): add collectionOptions option to schemas #13513
- fix: move all MongoDB-specific connection logic into driver layer, add createClient() method to handle creating MongoClient #13542
- fix(document): allow setting keys with dots in mixed paths underneath nested paths #13536
- types: augment bson.ObjectId instead of adding on own type #13515 #12537 hasezoey
- docs(guide): fix md lint #13593 hasezoey
- docs: changed the code from 'await author.save()' to 'await story1.save()' #13596 SomSingh23
7.3.4
7.3.4 / 2023-07-12
- chore: release 7.4.4 to overwrite accidental publish of 5.13.20 to latest tag
7.3.3
7.3.2
7.3.2 / 2023-07-06
- fix(model): avoid TypeError if insertMany() fails with error that does not have writeErrors property #13579 #13531
- fix(query): convert findOneAndUpdate to findOneAndReplace when overwrite set for backwards compat with Mongoose 6 #13572 #13550
- fix(query): throw readable error when executing a Query instance without an associated model #13571 #13570
- types: support mongoose.Schema.ObjectId as alias for mongoose.Schema.Types.ObjectId #13543 #13534
- docs(connections): clarify that socketTimeoutMS now defaults to 0 #13576 #13537
- docs(migrating_to_7): add mapReduce() removal to migration guide #13568 #13548
- docs(schemas): fix typo in schemas.md #13540 Metehan-Altuntekin
7.3.1
7.3.1 / 2023-06-21
- fix(query): respect query-level strict option on findOneAndReplace() #13516 #13507
- docs(connections): expand docs on serverSelectionTimeoutMS #13533 #12967
- docs: add example of accessing save options in pre save #13498
- docs(connections+faq): add info on localhost vs 127.0.0.1
- docs(SchemaType): validate members are validator & message (not msg) #13521 lorand-horvath
7.3.0
7.3.0 / 2023-06-14
- feat: upgrade mongodb -> 5.6.0 #13455 lorand-horvath
- feat(aggregate): add Aggregate.prototype.finally() to be consistent with Promise API for TypeScript #13509
- feat(schema): support selecting subset of fields to apply optimistic concurrency to #13506 #10591
- feat(model): add
ordered
option toModel.create()
#13472 #4038 - feat(schema): consistently add .get() function to all SchemaType classes
- feat(populate): pass virtual to match function to allow merging match options #13477 #12443
- types: allow overwriting Paths in select() to tell TypeScript which fields are projected #13478 #13224
- types(schema): add validateModifiedOnly as schema option #13503 #10153
- docs: add note about validateModifiedOnly as a schema option #13503 #10153
- docs(migrating_to_7): update migrating_to_7.md to include Model.countDocuments #13508 Climax777
- docs(further_reading): remove style for "img" hasezoey