Skip to content

Releases: Automattic/mongoose

8.6.3

17 Sep 20:31
Compare
Choose a tag to compare

8.6.3 / 2024-09-17

  • fix: make getters convert uuid to string when calling toObject() and toJSON() #14890 #14869
  • fix: fix missing Aggregate re-exports for ESM #14886 wongsean
  • types(document): add generic param to depopulate() to allow updating properties #14891 #14876

8.6.2

11 Sep 18:59
Compare
Choose a tag to compare

8.6.2 / 2024-09-11

8.6.1

03 Sep 16:16
Compare
Choose a tag to compare

8.6.1 / 2024-09-03

  • fix(document): avoid unnecessary clone() in applyGetters() that was preventing getters from running on 3-level deep subdocuments #14844 #14840 #14835
  • fix(model): throw error if bulkSave() did not insert or update any documents #14837 #14763
  • fix(cursor): throw error in ChangeStream constructor if changeStreamThunk() throws a sync error #14846
  • types(query): add $expr to RootQuerySelector #14845
  • docs: update populate.md to fix missing match: { } #14847 makhoulshbeeb

8.6.0

28 Aug 18:43
Compare
Choose a tag to compare

8.6.0 / 2024-08-28

  • feat: upgrade mongodb -> 6.8.0, handle throwing error on closed cursor in Mongoose with MongooseError instead of MongoCursorExhaustedError #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

28 Aug 17:08
Compare
Choose a tag to compare

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

23 Aug 17:46
Compare
Choose a tag to compare

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

14 Aug 09:39
Compare
Choose a tag to compare

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

30 Jul 18:18
Compare
Choose a tag to compare

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

12 Jul 19:27
Compare
Choose a tag to compare

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

08 Jul 20:54
Compare
Choose a tag to compare

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