All Versions
655
Latest Version
Avg Release Cycle
7 days
Latest Release
1431 days ago

Changelog History
Page 2

  • v5.12.13 Changes

    June 04, 2021
    • perf(document): avoid creating nested paths when running $getAllSubdocs() #10275
    • fix: make returnDocument option work with findOneAndUpdate() #10232 #10231 cnwangjie
    • fix(document): correctly reset subdocument when resetting a map subdocument underneath a single nested subdoc after save #10295
    • perf(query): avoid setting non-null sessions to avoid overhead from $getAllSubdocs() #10275
    • perf(document): pre split schematype paths when compiling schema to avoid extra overhead of splitting when hydrating documents #10275
    • perf(schema): pre-calculate mapPaths to avoid looping over every path for each path when initing doc #10275
    • fix(index.d.ts): drill down into nested arrays when creating LeanDocument type #10293
  • v5.12.12 Changes

    May 28, 2021
    • fix(documentarray): retain atomics when setting to a new array #10272
    • fix(query+model): fix deprecation warning for returnOriginal with findOneAndUpdate() #10298 #10297 #10292 #10285 IslandRhythms
    • fix(index.d.ts): make map() result an array if used over an array #10288 quantumsheep
  • v5.12.11 Changes

    May 24, 2021
    • fix(populate): skip applying setters when casting arrays for populate() to avoid issues with arrays of immutable elements #10264
    • perf(schematype): avoid cloning setters every time we run setters #9588
    • perf(get): add benchmarks and extra cases to speed up get() #9588
    • perf(array): improve array constructor performance on small arrays to improve nested array perf #9588
    • fix(index.d.ts): allow using type: [String] with string[] when using SchemaDefinition with generic #10261
    • fix(index.d.ts): support ReadonlyArray as well as regular array where possible in schema definitions #10260
    • docs(connection): document noListener option to useDb #10278 stuartpb
    • docs: migrate raw tutorial content from pug / JS to markdown #10271
    • docs: fix typo #10269 sanjib
  • v5.12.10 Changes

    May 18, 2021
    • fix(query): allow setting defaults option on result documents from query options #7287 IslandRhythms
    • fix(populate): handle populating embedded discriminator with custom tiedValue #10231
    • fix(document): allow passing space-delimited string of pathsToValidate to validate() and validateSync() #10258
    • fix(model+schema): support loadClass() on classes that have collection as a static property #10257 #10254 IslandRhythms
    • fix(SchemaArrayOptions): correct property name #10236
    • fix(index.d.ts): add any to all query operators to minimize likelihood of "type instantiation is excessively deep" when querying docs with 4-level deep subdocs #10189
    • fix(index.d.ts): add $parent() in addition to parent() in TS definitions
    • fix(index.d.ts): correct async iterator return type for QueryCursor #10253 #10252 #10251 borfig
    • fix(index.d.ts): add virtualsOnly parameter to loadClass() function signature IslandRhythms
    • docs(typescript): add typescript populate docs #10212
    • docs: switch from AWS to Azure Functions for search #10244
  • v5.12.9 Changes

    May 13, 2021
    • fix(schema): ensure add() overwrites existing schema paths by default #10208 #10203
    • fix(schema): support creating nested paths underneath document arrays #10193
    • fix(update): convert nested dotted paths in update to nested paths to avoid ending up with dotted properties in update #10200
    • fix(document): allow calling validate() and validateSync() with options as first parameter #10216
    • fix(schema): apply static properties to model when using loadClass() #10206
    • fix(index.d.ts): allow returning Promise from middleware functions #10229
    • fix(index.d.ts): add pre('distinct') hooks to TypeScript #10192
  • v5.12.8 Changes

    May 10, 2021
    • fix(populate): handle populating immutable array paths #10159
    • fix(CastError): add toJSON() function to ensure name property always ends up in JSON.stringify() output #10166 IslandRhythms
    • fix(query): add allowDiskUse() method to improve setting MongoDB 4.4's new allowDiskUse option #10177
    • fix(populate): allow populating paths under mixed schematypes where some documents have non-object properties #10191
    • chore: remove unnecessary driver dynamic imports so Mongoose can work with Parcel #9603
    • fix(index.d.ts): allow any object as parameter to create() and insertMany() #10144
    • fix(index.d.ts): allow creating Model class with raw interface, no extends Document #10144
    • fix(index.d.ts): separate UpdateQuery from UpdateWithAggregationPipeline for cases when UpdateQuery is used as a function param #10186
    • fix(index.d.ts): don't require error value in pre/post hooks #10213 michaln-q
    • docs(typescript): add a typescript intro tutorial and statics tutorial #10021
    • docs(typescript): add query helpers tutorial #10021
    • docs(deprecations): add note that you can safely ignore useFindAndModify and useCreateIndex deprecation warnings #10155
    • chore(workflows): add node 16 to github actions #10201 AbdelrahmanHafez
  • v5.12.7 Changes

    April 29, 2021
    • fix(document): make $getPopulatedDocs() return populated virtuals #10148
    • fix(discriminator): take discriminator schema's single nested paths over base schema's #10157
    • fix(discriminator): allow numbers and ObjectIds as tied values for discriminators #10130
    • fix(document): avoid double validating paths underneath mixed objects in save() #10141
    • fix(schema): allow path() to return single nested paths within document arrays #10164
    • fix(model+query): consistently wrap query callbacks in process.nextTick() to avoid clean stack traces causing memory leak when using synchronous recursion like async.whilst() #9864
    • fix(cursor): correctly report CastError when using noCursorTimeout flag #10150
    • fix(index.d.ts): add CastError constructor #10176
    • fix(index.d.ts): allow setting mongoose.pluralize(null) in TypeScript #10185
    • docs: add link to transactions guide from nav bar #10143
    • docs(validation): add section about custom error messages #10140
    • docs: make headers linkable via clicking #10156
    • docs: broken link in document.js #10190 joostdecock
    • docs: make navbar responsive on legacy 2.x docs #10171 ad99526
  • v5.12.6 Changes

    April 27, 2021
    • fix(query): allow setting writeConcern schema option to work around MongoDB driver's writeConcern deprecation warning #10083 #10009 IslandRhythms
    • fix(populate): dedupe when virtual populate foreignField is an array to avoid duplicate docs in result #10117
    • fix(populate): add localField filter to $elemMatch on virtual populate when custom match has a $elemMatch and foreignField is an array #10117
    • fix(query): convert projection string values to numbers as a workaround for #10142
    • fix(document): set version key filter on save() when using optimisticConcurrency if no changes in document #10128 IslandRhythms
    • fix(model): use obj as context in Model.validate() if obj is a document #10132
    • fix(connection): avoid db events deprecation warning when using useDb() with useUnifiedTopology #8267
    • fix: upgrade to [email protected] to work around transitive dev dependency security warning #10121
    • fix(index.d.ts): allow any object as parameter to create() and insertMany() #10144
    • fix(index.d.ts): clarify that eachAsync() callback receives a single doc rather than array of docs unless batchSize is set #10135
    • fix(index.d.ts): clarify that return value from validateSync() is a ValidationError #10147 michaln-q
    • fix(index.d.ts): add generic type for Model constructor #10074 Duchynko
    • fix(index.d.ts): add parameter type in merge #10168 yoonhoGo
  • v5.12.5 Changes

    April 19, 2021
    • fix(populate): handle populating underneath document array when document array property doesn't exist in db #10003
    • fix(populate): clear out dangling pointers to populated docs so query cursor with populate() can garbage collect populated subdocs #9864
    • fix(connection): pull correct autoCreate value from Mongoose global when creating new model before calling connect() #10091
    • fix(populate): handle populating paths on documents with discriminator keys that point to non-existent discriminators #10082
    • fix(index.d.ts): allow numbers as discriminator names #10115
    • fix(index.d.ts): allow type: Boolean in Schema definitions #10085
    • fix(index.d.ts): allow passing array of aggregation pipeline stages to updateOne() and updateMany() #10095
    • fix(index.d.ts): support legacy 2nd param callback syntax for deleteOne(), deleteMany() #10122
    • docs(mongoose): make useCreateIndex always false in docs #10033
    • docs(schema): fix incorrect links from schema API docs #10111
  • v5.12.4 Changes

    April 15, 2021
    • fix: upgrade mongodb driver -> 3.6.6 #10079
    • fix: store fields set with select:false at schema-level when saving a new document #10101 ptantiku
    • fix(populate): avoid turning already populated field to null when populating an existing lean document #10068 IslandRhythms
    • fix(populate): correctly populate lean subdocs with _id property #10069
    • fix(model): insertedDocs may contain docs that weren't inserted #10098 olnazx
    • fix(schemaType): make type Mixed cast error objects to pojos #10131 AbdelrahmanHafez
    • fix(populate): support populating embedded discriminators in nested arrays #9984
    • fix(populate): handle populating map paths using trailing .$* #10123
    • fix(populate): allow returning primitive from transform() function for single conventional populate #10064
    • fix(index.d.ts): allow generic classes of T to use T & Document internally #10046
    • fix(index.d.ts): allow $pull with $ paths #10075
    • fix(index.d.ts): use correct Date type for $currentDate #10058
    • fix(index.d.ts): add missing asyncInterator to Query type def #10094 borfig
    • fix(index.d.ts): allow RHS of $unset properties to be any value #10066
    • fix(index.d.ts): allow setting SchemaType index property to a string #10077
    • refactor(index.d.ts): move discriminator() to common interface #10109 LoneRifle