Skip to content

Releases: Automattic/mongoose

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

6.2.2

16 Feb 21:31
Compare
Choose a tag to compare

6.2.2 / 2022-02-16

  • fix: fix QueryCursor and AggregationCursor compatibility with Node v17.5 #11381 benjamingr
  • fix: better esm support, no necessity for setting allowSyntheticDefaultImports and esModuleInterop #11343 Uzlopak
  • fix(model): apply projection parameter to hydrate() #11375
  • fix: fix issue with creating arrays of length > 10000 #11405 Uzlopak
  • fix(document): minimize single nested subdocs #11247
  • fix(connection): handle reopening base connection with useDb() #11240
  • perf: use property access instead of get() helper where possible #11389 Uzlopak
  • fix: use isArray() instead of instanceof Array #11393 Uzlopak
  • perf: improve performance of cast$expr() #11388 Uzlopak
  • perf: remove startsWith() from isOperator() #11400 Uzlopak
  • fix(index.d.ts): extract PipelineStage into separate file #11368 Uzlopak
  • fix(index.d.ts): fix $search highlight path option type #11373 lmX2015
  • docs: update changelog file to CHANGELOG.md #11365 AbdelrahmanHafez
  • docs: fix broken links #11388 #11377 saibbyweb
  • docs: remove double determiners in connections docs #11340 Erma32

6.2.1

07 Feb 22:04
Compare
Choose a tag to compare

6.2.1 / 2022-02-07

  • perf: improve performance especially of validate and clone #11298 Uzlopak
  • perf: remove regexp-clone #11327 Uzlopak
  • fix(document): handle initing nested properties in non-strict documents #11309
  • fix(query): cast $elemMatch underneath $all #11314
  • fix(populate): respect schema-level strictPopulate option #11290
  • fix: set default for dotted path projection #11293 noseworthy
  • fix(model): correctly handle writeConcern.w = 0 when saving #11300
  • fix(model): throw VersionError when saving with no changes and optimisticConcurrency = true #11295
  • fix(query): avoid adding $each to $addToSet on mixed arrays #11284
  • fix(index.d.ts): allow using type: [Schema.Types.ObjectId] for ObjectId arrays #11194
  • fix(index.d.ts): make Types.DocumentArray<> convert type to subdoc, rename TMethods -> TMethodsAndOverrides #11061
  • fix(index.d.ts): support passing generic to createCollection() and collection() for integration with MongoDB Node driver's collection class #11131
  • fix(index.d.ts): add strictPopulate to MongooseOptions #11276
  • docs: mark Mongoose 6 as compatible with MongoDB 4 #11320 JavaScriptBach
  • docs: remove documentation for useNestedStrict #11313 mark-langer
  • docs: add "new" to ObjectId class in aggregate.js docs #11322 JavanPoirier
  • chore: handle eslint configuration in .eslintrc.json #11326 Uzlopak
  • refactor: add parenthesis for constructors in tests #11330 apeltop

6.2.0

02 Feb 18:52
Compare
Choose a tag to compare

6.2.0 / 2022-02-02

  • feat(connection+mongoose): add support for continueOnError for syncIndexes #11266 AbdelrahmanHafez
  • feat(query): cast literals in $expr where possible #10663
  • feat(schema+mongoose): add pluginTags to allow applying global plugins to only schemas with matching tags #9780
  • feat(discriminator): support overwriteModels:true to reuse discriminator names #11244 #10931 IslandRhythms
  • feat(index.d.ts): add DocType generic param to Model functions that return queries to better support projections #11156
  • feat(error): export MongooseServerSelectionError #11202
  • feat(schematype): add validators, path, isRequired to public API and TypeScript types #11139
  • fix(model): make exists(...) return lean document with _id or null instead of boolean #11142 AbdelrahmanHafez
  • fix(model): support storing versionKey in nested paths #10980
  • fix(index.d.ts): add options to bulkSave() type def #11201 Uzlopak
  • fix(index.d.ts): better support for query projections #11210 EugeneKorshenko

6.1.10

02 Feb 18:57
Compare
Choose a tag to compare

6.1.10 / 2022-02-01

  • fix(mongoose): correctly handle destructured isValidObjectId #11304
  • fix(mongoose): defer to MongoDB driver isValid() for isValidObjectId() #11227

6.1.8

24 Jan 19:24
Compare
Choose a tag to compare

6.1.8 / 2022-01-24

  • fix(connection): stop leaking sessions in .transaction() #11259 #11256 Uzlopak
  • perf: remove sliced in favor of Array.prototype.slice() #11238 Uzlopak
  • perf: improve setDottedPath #11264 Uzlopak
  • fix(document): handle edge case where NestJS sets String.type = String, mixing up schema definitions #11199
  • fix: remove obsolete code after upgrading to bson4 #11265 Uzlopak
  • fix: remove util.isArray in favor of Array.isArray #11234 Uzlopak
  • fix(index.d.ts): avoid UnpackedIntersection making findOne().populate() result non-nullable #11041
  • docs(migration): add note to change default functions to schema #11245 AbdelrahmanHafez
  • docs: updated docs and issue templates for new FAQs #11171 IslandRhythms
  • chore: fix casting benchmark #11262 Uzlopak
  • chore: add mongodb-memory-server to test easier locally #11255 Uzlopak
  • chore: fix testing tsconfig #11243 Uzlopak
  • refactor: move utils.random to test folder #11239 Uzlopak

6.1.7

17 Jan 16:00
Compare
Choose a tag to compare

6.1.7 / 2022-01-17

  • fix(model): correct handling for $push on a nested array #11108
  • fix(update): correctly apply timestamps to update pipelines #11151
  • fix(document): correctly handle modifying array subdocument after setting array subdocument to itself #11172
  • fix(index.d.ts): allow passing options to model() in place of removed skipInit #11137
  • fix(aggregate): allow passing verbosity to Aggregate.prototype.explain() #11144
  • fix(index.d.ts): avoid TypeScript inferring _id as any type with HydratedDocument #11085
  • docs: fix Node.js Driver compat link #11214 wesbos
  • docs: remove extraneous backquote #11204 joebowbeer

6.1.6

10 Jan 16:44
Compare
Choose a tag to compare

6.1.6 / 2022-01-10

  • perf(document): delay creating document event emitter until used to improve memory usage, several small improvements to improve initing docs with large arrays #10400
  • fix(model): avoid bulkSave() error when versionKey: false #11186 #11071 IslandRhythms
  • fix(model): revert #11079: findByIdAndUpdate(undefined) breaking change #11149
  • fix(index.d.ts): support strings in deep populate #11181 ivalduan
  • fix(index.d.ts): rename map() -> transform() to line up with change in v6.0 #11161
  • fix(index.d.ts): allow new Model(obj) for stricter type checks #11148
  • fix(index.d.ts): make Schema.prototype.pre() and post() generics default to HydratedDocument #11180
  • docs: improve autoCreate docs #11116
  • docs(schematype): add missing parameter to example #11185 kerolloz
  • docs(connections): use updated link to list of MongoDB Node driver connect() options #11184 splinter
  • docs(aggregate): fix formatting #11191 enieber
  • docs: fix broken link #11179 khairnarsaurabh23