Skip to content

Releases: Automattic/mongoose

6.3.0

14 Apr 17:03
Compare
Choose a tag to compare

6.3.0 / 2022-04-14

  • fix: upgrade mongodb driver -> 4.5.0 #11623 AbdelrahmanHafez
  • feat(schema): allow defining discriminators on schema and in schema definition #7971 IslandRhythms
  • feat(base): add option to set allowDiskUse globally #11554 AbdelrahmanHafez
  • feat(schema): add removeIndex() and clearIndex() #11547 IslandRhythms
  • feat(cursor): add continueOnError option to allow executing eachAsync() on all docs even if error occurs #6355
  • feat(query): add versionKey option to lean() for removing version key from lean docs #8934 IslandRhythms
  • feat(types): create new ProjectionType type for select(), find(), etc. #11437
  • chore: use webpack 5 for browser build #11584 AbdelrahmanHafez

6.2.11

13 Apr 17:02
Compare
Choose a tag to compare

6.2.11 / 2022-04-13

  • fix(document): handle validation with triply nested document arrays #11564
  • fix(query): skip applying string schema setters on $regex #11426
  • fix: skip findOneAndReplace() validation if runValidators = false #11559
  • fix(model): correctly handle schema-level collations in syncIndexes() #7621
  • fix(types): correct populate query return type with lean #11560 mohammad0-0ahmad
  • fix(types): allow using { type: Mixed } as schema type definition for any path #10900
  • docs: fix example on Schema.prototype.post() #11648 EmilienLeroy
  • docs: fix typo in methods/index.js #11651 eltociear

6.2.10

04 Apr 19:48
Compare
Choose a tag to compare

6.2.10 / 2022-04-04

6.2.9

28 Mar 16:37
Compare
Choose a tag to compare

6.2.9 / 2022-03-28

  • perf(document+model): make a few small optimizations #11380
  • fix(types): improve populate return type #11560 mohammad0-0ahmad
  • fix(document): avoid marking paths as modified on subdocument defaults #11528
  • docs(schema): add example to index expires option #11557 boly38
  • docs(model): add change stream docs #11275
  • docs(lambda): update Lambda docs for Mongoose 6 #11275
  • docs(connections): add note about connecting with X509 #11333
  • docs(populate): fix incorrect path name in refPath example #11565 chandiwalaaadhar

6.2.8

23 Mar 01:54
Compare
Choose a tag to compare

6.2.8 / 2022-03-22

  • fix(document): handle casting array of spread docs #11522
  • fix(document): avoid setting nested properties on top-level document when initing with strict: false #11526
  • fix(document): correctly handle deeply nested subdocuments when getting paths to validate #11501
  • fix(types): avoid making TInstanceMethods any by default leading to this = any in middleware #11435
  • fix(types): allow defining array default if using Types.Array<> in document interface #11391
  • docs(migrating_to_6): describe breaking change in Mongoose 6 about default query populate model #11289
  • docs(middleware): fix typo #11537 x1489

6.2.7

16 Mar 16:41
Compare
Choose a tag to compare

6.2.7 / 2022-03-16

  • perf(document): avoid running validation on every array element if there's no validators to run #11380
  • fix(cursor): correctly populate in batches when batchSize is set #11509
  • fix(connection): avoid setting MongoClient on useDb() connections until after setting on base connection #11445
  • fix(schema): throw more helpful error when using schema from a different version of Mongoose module #10453
  • fix: add missing timeseries expiration handling #11489 #11229 Uzlopak
  • docs: correct Model.findOneAndReplace docs param naming #11524 anatolykopyl

6.2.6

11 Mar 22:39
Compare
Choose a tag to compare

6.2.6 / 2022-03-11

  • fix(types): correct reference to cursor TypeScript bindings #11513 SimonHausdorf
  • fix(types): allow calling Query.prototype.populate() with array of strings #11518
  • fix(types): export and refactor types of PreMiddlewareFunction, PreSaveMiddlewareFunction, PostMiddlewareFunction, ErrorHandlingMiddlewareFunction #11485 Uzlopak

6.2.5

09 Mar 16:59
Compare
Choose a tag to compare

6.2.5 / 2022-03-09

  • fix(mongoose): add isObjectIdOrHexString() to better capture the most common use case for isValidObjectId() #11419
  • fix(query): prevent modifying discriminator key in updates using operators other than $set #11456
  • fix(populate+types): call foreignField functions with doc as 1st param, better typings for localField and foreignField functions #11321
  • fix(populate): return an array when using populate count on an array localField #11307
  • fix(query): avoid error when using $not with arrays #11467
  • perf: only deep clone validators if necessary #11412 Uzlopak
  • fix(types): rename definition files to lowercase to avoid typescript bug #11469
  • fix(types): aggregate.sort() accepts a string but also { field: 'asc'|'ascending'|'desc'|'descending' } #11479 simonbrunel
  • fix(types): extract and refactor aggregationcursor and querycursor #11488 Uzlopak
  • fix(types): extract and refactor schemaoptions #11484 Uzlopak
  • fix(types): make first param to Query.prototype.populate() a string #11475 minhthinhls
  • fix(types): improve type checking for doc arrays in schema definitions #11241
  • docs: fix length comparaison in lean.test.js #11493 zazapeta
  • docs(timestamps): fix typo #11481 saibbyweb
  • docs: fix broken link to rawResult #11459 chhiring90

6.2.4

28 Feb 22:05
Compare
Choose a tag to compare

6.2.4 / 2022-02-28

  • fix(query): correctly return full deleteOne(), deleteMany() result #11211
  • fix(query): handle update validators on deeply nested subdocuments #11455 #11394
  • fix(discriminator): handle modifying multiple nested paths underneath a discriminator #11428
  • perf: improve isAsyncFunction #11408 Uzlopak
  • fix(index.d.ts): add typedefs for Schema pick() #11448 Moisei-Shkil
  • fix(index.d.ts): allow type override for distinct() #11306
  • fix(index.d.ts): allow array of validators in schema definition #11355
  • fix(index.d.ts): improve connection typings #11418 Uzlopak
  • docs: add timestamps docs #11336
  • docs(timestamps): explain how timestamps works under the hood #11336
  • docs(migrating_to_6): add model.exists breaking change returning doument instead of boolean #11407 AbdelrahmanHafez
  • docs(index.d.ts): add docs for FilterQuery, UpdateQuery, and LeanDocument #11457 Moisei-Shkil

6.2.3

21 Feb 19:10
Compare
Choose a tag to compare

6.2.3 / 2022-02-21

  • fix(model): avoid dropping base model indexes when using discriminators with Connection.prototype.syncIndexes() #11424 #11421 AbdelrahmanHafez
  • fix(document): handle array defaults when selecting element underneath array #11376
  • fix(populate): correctly handle depopulating populated subdocuments #11436
  • fix(utils): improve deepEqual() handling for comparing objects with non-objects #11417
  • fix(schema): allow declaring array of arrays using [{ type: [String] }] #11252
  • perf: improve validation sync and async by replacing forEach with classic for loops #11414 Uzlopak
  • perf: make hasDollarKeys faster #11401 Uzlopak
  • fix(index.d.ts): ValidationError errors only contains CastError or ValidationError #11369 Uzlopak
  • fix(index.d.ts): make InsertManyResult.insertedIds return an array of Types.ObjectId by default #11197
  • fix(index.d.ts): allow pre('save') middleware with pre options #11257
  • fix(index.d.ts): add supressReservedKeysWarning option to schema #11439 hiukky
  • docs(connections): improve replica set hostname docs with correct error message and info about err.reason.servers #11200
  • docs(populate): add virtual populate match option documentation #11411 remirobichet
  • docs(document): add note to API docs that flattenMaps defaults to true for toJSON() but not toObject() #11213
  • docs(document+model): add populate option to populate() API docs #11170
  • docs(migrating_to_6): add additional info about removing omitUndefined #11038
  • docs(migrating_to_6): add model.exists breaking change returning doument instead of boolean AbdelrahmanHafez