Releases: Automattic/mongoose
Releases · Automattic/mongoose
6.2.3
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
fortoJSON()
but nottoObject()
#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
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 ofinstanceof Array
#11393 Uzlopak - perf: improve performance of
cast$expr()
#11388 Uzlopak - perf: remove
startsWith()
fromisOperator()
#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
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
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
6.1.8
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
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
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 whenversionKey: 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
6.1.5
6.1.5 / 2022-01-04
- perf(index.d.ts): simplify Schema typedef for query helpers and methods to significantly reduce TS compiler overhead #10349
- fix(document): allow populating deeply nested models as strings #11168 #11160 AbdelrahmanHafez
- fix(query): allow calling limit() and skip() with a string #11017
- fix(cursor): propery apply selected fields when loading discriminator docs with query cursor #11130
- fix(mongoose+connection): clone schema correctly when passing instance of another Mongoose instance's Schema to Connection.prototype.model() #11047
- fix(index.d.ts): handle primitives with FlattenMaps #11117
- fix(index.d.ts): enforce id on lean query result type #11118
- fix(index.d.ts): export facet stage type #11150 mhoc
- fix(index.d.ts): correct return type of projection method #11176 EugeneKorshenko
- fix(index.d.ts): additional fix for
$group
pipeline stage #11140 #11067 EugeneKorshenko - docs: update CONTRIBUTING.md for TS tests #11164 ahmedelshenawy25
- docs: use es6 object destructuring instead of regular dot operator for accessing value in object #11147 Shivaansh-Agarwal
6.1.4
6.1.4 / 2021-12-27
- fix(document): handle save with undefined nested doc under subdoc #11110
- fix(document): allow manually populating subdocument refs with
create()
#10856 - fix(populate): handles refPath underneath map of subdocuments #9359
- fix(update): throw error when calling findByIdAndUpdate with undefined id #11079 gramliu
- fix(mongoose): export ConnectionStates #11133 orgads
- fix(index.d.ts): unpack array when using generic type override with
populate()
#11027 - fix(index.d.ts): fix typings in Merge stage #11132
- fix(index.d.ts): PipelineStage.Merge interface definition is wrong #11109
- docs(typescript): add note about Schema.Types.ObjectId vs Types.ObjectId in document definition #10949
- docs(connection): clarify that "connected" and "open" are different #10886
- docs(populate): correct refPath example to not use on as a schema path name #11113
- docs: fix
strictQuery
example #11135 MontgomeryWatts