mongoose 6.2.2 → 6.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.lgtm.yml +3 -0
- package/CHANGELOG.md +53 -0
- package/dist/browser.umd.js +78 -74
- package/lib/document.js +31 -26
- package/lib/helpers/document/cleanModifiedSubpaths.js +1 -0
- package/lib/helpers/indexes/decorateDiscriminatorIndexOptions.js +14 -0
- package/lib/helpers/indexes/getRelatedIndexes.js +59 -0
- package/lib/helpers/isAsyncFunction.js +6 -7
- package/lib/helpers/isSimpleValidator.js +22 -0
- package/lib/helpers/populate/assignVals.js +15 -3
- package/lib/helpers/populate/getModelsMapForPopulate.js +1 -1
- package/lib/helpers/query/castUpdate.js +21 -6
- package/lib/helpers/query/hasDollarKeys.js +7 -3
- package/lib/helpers/schema/getIndexes.js +6 -2
- package/lib/index.js +38 -2
- package/lib/internal.js +9 -1
- package/lib/model.js +41 -55
- package/lib/query.js +11 -11
- package/lib/queryhelpers.js +0 -20
- package/lib/schema/SubdocumentPath.js +1 -1
- package/lib/schema/array.js +1 -0
- package/lib/schema/documentarray.js +5 -4
- package/lib/schema.js +4 -0
- package/lib/schematype.js +23 -23
- package/lib/types/ArraySubdocument.js +1 -1
- package/lib/types/map.js +1 -1
- package/lib/utils.js +9 -3
- package/package.json +16 -18
- package/types/connection.d.ts +212 -0
- package/types/cursor.ts +48 -0
- package/types/error.d.ts +129 -0
- package/types/index.d.ts +65 -583
- package/types/{PipelineStage.d.ts → pipelinestage.d.ts} +0 -0
- package/types/schemaoptions.d.ts +183 -0
package/.lgtm.yml
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,56 @@
|
|
|
1
|
+
6.2.5 / 2022-03-09
|
|
2
|
+
==================
|
|
3
|
+
* fix(mongoose): add isObjectIdOrHexString() to better capture the most common use case for `isValidObjectId()` #11419
|
|
4
|
+
* fix(query): prevent modifying discriminator key in updates using operators other than `$set` #11456
|
|
5
|
+
* fix(populate+types): call foreignField functions with doc as 1st param, better typings for `localField` and `foreignField` functions #11321
|
|
6
|
+
* fix(populate): return an array when using populate count on an array localField #11307
|
|
7
|
+
* fix(query): avoid error when using $not with arrays #11467
|
|
8
|
+
* perf: only deep clone validators if necessary #11412 [Uzlopak](https://github.com/Uzlopak)
|
|
9
|
+
* fix(types): rename definition files to lowercase to avoid typescript bug #11469
|
|
10
|
+
* fix(types): aggregate.sort() accepts a string but also `{ field: 'asc'|'ascending'|'desc'|'descending' }` #11479 [simonbrunel](https://github.com/simonbrunel)
|
|
11
|
+
* fix(types): extract and refactor aggregationcursor and querycursor #11488 [Uzlopak](https://github.com/Uzlopak)
|
|
12
|
+
* fix(types): extract and refactor schemaoptions #11484 [Uzlopak](https://github.com/Uzlopak)
|
|
13
|
+
* fix(types): make first param to `Query.prototype.populate()` a string #11475 [minhthinhls](https://github.com/minhthinhls)
|
|
14
|
+
* fix(types): improve type checking for doc arrays in schema definitions #11241
|
|
15
|
+
* docs: fix length comparaison in lean.test.js #11493 [zazapeta](https://github.com/zazapeta)
|
|
16
|
+
* docs(timestamps): fix typo #11481 [saibbyweb](https://github.com/saibbyweb)
|
|
17
|
+
* docs: fix broken link to rawResult #11459 [chhiring90](https://github.com/chhiring90)
|
|
18
|
+
|
|
19
|
+
6.2.4 / 2022-02-28
|
|
20
|
+
==================
|
|
21
|
+
* fix(query): correctly return full deleteOne(), deleteMany() result #11211
|
|
22
|
+
* fix(query): handle update validators on deeply nested subdocuments #11455 #11394
|
|
23
|
+
* fix(discriminator): handle modifying multiple nested paths underneath a discriminator #11428
|
|
24
|
+
* perf: improve isAsyncFunction #11408 [Uzlopak](https://github.com/Uzlopak)
|
|
25
|
+
* fix(index.d.ts): add typedefs for Schema `pick()` #11448 [Moisei-Shkil](https://github.com/Moisei-Shkil)
|
|
26
|
+
* fix(index.d.ts): allow type override for distinct() #11306
|
|
27
|
+
* fix(index.d.ts): allow array of validators in schema definition #11355
|
|
28
|
+
* fix(index.d.ts): improve connection typings #11418 [Uzlopak](https://github.com/Uzlopak)
|
|
29
|
+
* docs: add timestamps docs #11336
|
|
30
|
+
* docs(timestamps): explain how timestamps works under the hood #11336
|
|
31
|
+
* docs(migrating_to_6): add model.exists breaking change returning doument instead of boolean #11407 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
|
|
32
|
+
* docs(index.d.ts): add docs for FilterQuery, UpdateQuery, and LeanDocument #11457 [Moisei-Shkil](https://github.com/Moisei-Shkil)
|
|
33
|
+
|
|
34
|
+
6.2.3 / 2022-02-21
|
|
35
|
+
==================
|
|
36
|
+
* fix(model): avoid dropping base model indexes when using discriminators with `Connection.prototype.syncIndexes()` #11424 #11421 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
|
|
37
|
+
* fix(document): handle array defaults when selecting element underneath array #11376
|
|
38
|
+
* fix(populate): correctly handle depopulating populated subdocuments #11436
|
|
39
|
+
* fix(utils): improve deepEqual() handling for comparing objects with non-objects #11417
|
|
40
|
+
* fix(schema): allow declaring array of arrays using `[{ type: [String] }]` #11252
|
|
41
|
+
* perf: improve validation sync and async by replacing forEach with classic for loops #11414 [Uzlopak](https://github.com/Uzlopak)
|
|
42
|
+
* perf: make hasDollarKeys faster #11401 [Uzlopak](https://github.com/Uzlopak)
|
|
43
|
+
* fix(index.d.ts): ValidationError `errors` only contains CastError or ValidationError #11369 [Uzlopak](https://github.com/Uzlopak)
|
|
44
|
+
* fix(index.d.ts): make InsertManyResult.insertedIds return an array of Types.ObjectId by default #11197
|
|
45
|
+
* fix(index.d.ts): allow pre('save') middleware with pre options #11257
|
|
46
|
+
* fix(index.d.ts): add `supressReservedKeysWarning` option to schema #11439 [hiukky](https://github.com/hiukky)
|
|
47
|
+
* docs(connections): improve replica set hostname docs with correct error message and info about `err.reason.servers` #11200
|
|
48
|
+
* docs(populate): add virtual populate match option documentation #11411 [remirobichet](https://github.com/remirobichet)
|
|
49
|
+
* docs(document): add note to API docs that flattenMaps defaults to `true` for `toJSON()` but not `toObject()` #11213
|
|
50
|
+
* docs(document+model): add populate option to populate() API docs #11170
|
|
51
|
+
* docs(migrating_to_6): add additional info about removing omitUndefined #11038
|
|
52
|
+
* docs(migrating_to_6): add model.exists breaking change returning doument instead of boolean [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
|
|
53
|
+
|
|
1
54
|
6.2.2 / 2022-02-16
|
|
2
55
|
==================
|
|
3
56
|
* fix: fix QueryCursor and AggregationCursor compatibility with Node v17.5 #11381 [benjamingr](https://github.com/benjamingr)
|