mongoose 6.2.3 → 6.2.6
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 +40 -0
- package/dist/browser.umd.js +70 -66
- package/lib/document.js +7 -11
- package/lib/helpers/document/cleanModifiedSubpaths.js +1 -0
- package/lib/helpers/isAsyncFunction.js +6 -7
- package/lib/helpers/isSimpleValidator.js +22 -0
- package/lib/helpers/populate/assignVals.js +11 -3
- package/lib/helpers/populate/getModelsMapForPopulate.js +1 -1
- package/lib/helpers/query/castUpdate.js +21 -6
- package/lib/index.js +38 -2
- package/lib/model.js +6 -6
- 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/schematype.js +15 -14
- package/lib/types/ArraySubdocument.js +1 -1
- package/package.json +1 -1
- package/types/connection.d.ts +212 -0
- package/types/cursor.d.ts +48 -0
- package/types/document.d.ts +244 -0
- package/types/{Error.d.ts → error.d.ts} +0 -0
- package/types/index.d.ts +64 -705
- 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,42 @@
|
|
|
1
|
+
6.2.6 / 2022-03-11
|
|
2
|
+
==================
|
|
3
|
+
* fix(types): correct reference to cursor TypeScript bindings #11513 [SimonHausdorf](https://github.com/SimonHausdorf)
|
|
4
|
+
* fix(types): allow calling Query.prototype.populate() with array of strings #11518
|
|
5
|
+
* fix(types): export and refactor types of PreMiddlewareFunction, PreSaveMiddlewareFunction, PostMiddlewareFunction, ErrorHandlingMiddlewareFunction #11485 [Uzlopak](https://github.com/Uzlopak)
|
|
6
|
+
|
|
7
|
+
6.2.5 / 2022-03-09
|
|
8
|
+
==================
|
|
9
|
+
* fix(mongoose): add isObjectIdOrHexString() to better capture the most common use case for `isValidObjectId()` #11419
|
|
10
|
+
* fix(query): prevent modifying discriminator key in updates using operators other than `$set` #11456
|
|
11
|
+
* fix(populate+types): call foreignField functions with doc as 1st param, better typings for `localField` and `foreignField` functions #11321
|
|
12
|
+
* fix(populate): return an array when using populate count on an array localField #11307
|
|
13
|
+
* fix(query): avoid error when using $not with arrays #11467
|
|
14
|
+
* perf: only deep clone validators if necessary #11412 [Uzlopak](https://github.com/Uzlopak)
|
|
15
|
+
* fix(types): rename definition files to lowercase to avoid typescript bug #11469
|
|
16
|
+
* fix(types): aggregate.sort() accepts a string but also `{ field: 'asc'|'ascending'|'desc'|'descending' }` #11479 [simonbrunel](https://github.com/simonbrunel)
|
|
17
|
+
* fix(types): extract and refactor aggregationcursor and querycursor #11488 [Uzlopak](https://github.com/Uzlopak)
|
|
18
|
+
* fix(types): extract and refactor schemaoptions #11484 [Uzlopak](https://github.com/Uzlopak)
|
|
19
|
+
* fix(types): make first param to `Query.prototype.populate()` a string #11475 [minhthinhls](https://github.com/minhthinhls)
|
|
20
|
+
* fix(types): improve type checking for doc arrays in schema definitions #11241
|
|
21
|
+
* docs: fix length comparaison in lean.test.js #11493 [zazapeta](https://github.com/zazapeta)
|
|
22
|
+
* docs(timestamps): fix typo #11481 [saibbyweb](https://github.com/saibbyweb)
|
|
23
|
+
* docs: fix broken link to rawResult #11459 [chhiring90](https://github.com/chhiring90)
|
|
24
|
+
|
|
25
|
+
6.2.4 / 2022-02-28
|
|
26
|
+
==================
|
|
27
|
+
* fix(query): correctly return full deleteOne(), deleteMany() result #11211
|
|
28
|
+
* fix(query): handle update validators on deeply nested subdocuments #11455 #11394
|
|
29
|
+
* fix(discriminator): handle modifying multiple nested paths underneath a discriminator #11428
|
|
30
|
+
* perf: improve isAsyncFunction #11408 [Uzlopak](https://github.com/Uzlopak)
|
|
31
|
+
* fix(index.d.ts): add typedefs for Schema `pick()` #11448 [Moisei-Shkil](https://github.com/Moisei-Shkil)
|
|
32
|
+
* fix(index.d.ts): allow type override for distinct() #11306
|
|
33
|
+
* fix(index.d.ts): allow array of validators in schema definition #11355
|
|
34
|
+
* fix(index.d.ts): improve connection typings #11418 [Uzlopak](https://github.com/Uzlopak)
|
|
35
|
+
* docs: add timestamps docs #11336
|
|
36
|
+
* docs(timestamps): explain how timestamps works under the hood #11336
|
|
37
|
+
* docs(migrating_to_6): add model.exists breaking change returning doument instead of boolean #11407 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
|
|
38
|
+
* docs(index.d.ts): add docs for FilterQuery, UpdateQuery, and LeanDocument #11457 [Moisei-Shkil](https://github.com/Moisei-Shkil)
|
|
39
|
+
|
|
1
40
|
6.2.3 / 2022-02-21
|
|
2
41
|
==================
|
|
3
42
|
* fix(model): avoid dropping base model indexes when using discriminators with `Connection.prototype.syncIndexes()` #11424 #11421 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
|
|
@@ -10,6 +49,7 @@
|
|
|
10
49
|
* fix(index.d.ts): ValidationError `errors` only contains CastError or ValidationError #11369 [Uzlopak](https://github.com/Uzlopak)
|
|
11
50
|
* fix(index.d.ts): make InsertManyResult.insertedIds return an array of Types.ObjectId by default #11197
|
|
12
51
|
* fix(index.d.ts): allow pre('save') middleware with pre options #11257
|
|
52
|
+
* fix(index.d.ts): add `supressReservedKeysWarning` option to schema #11439 [hiukky](https://github.com/hiukky)
|
|
13
53
|
* docs(connections): improve replica set hostname docs with correct error message and info about `err.reason.servers` #11200
|
|
14
54
|
* docs(populate): add virtual populate match option documentation #11411 [remirobichet](https://github.com/remirobichet)
|
|
15
55
|
* docs(document): add note to API docs that flattenMaps defaults to `true` for `toJSON()` but not `toObject()` #11213
|