mongoose 5.12.12 → 5.13.0
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/History.md +42 -0
- package/dist/browser.umd.js +126 -120
- package/index.d.ts +105 -30
- package/lib/collection.js +1 -1
- package/lib/connection.js +1 -1
- package/lib/cursor/AggregationCursor.js +2 -1
- package/lib/cursor/QueryCursor.js +2 -1
- package/lib/document.js +102 -46
- package/lib/drivers/node-mongodb-native/collection.js +50 -7
- package/lib/drivers/node-mongodb-native/connection.js +3 -1
- package/lib/helpers/arrayDepth.js +3 -0
- package/lib/helpers/cursor/eachAsync.js +2 -1
- package/lib/helpers/immediate.js +3 -1
- package/lib/helpers/populate/getModelsMapForPopulate.js +1 -1
- package/lib/helpers/printJestWarning.js +7 -0
- package/lib/helpers/promiseOrCallback.js +3 -2
- package/lib/helpers/query/completeMany.js +7 -3
- package/lib/helpers/query/sanitizeProjection.js +14 -0
- package/lib/helpers/timers.js +3 -0
- package/lib/model.js +210 -13
- package/lib/query.js +34 -9
- package/lib/queryhelpers.js +7 -0
- package/lib/schema/array.js +6 -4
- package/lib/schema.js +32 -8
- package/lib/schematype.js +18 -0
- package/lib/types/array.js +1 -6
- package/lib/types/core_array.js +3 -1
- package/lib/utils.js +2 -1
- package/lib/validoptions.js +1 -0
- package/package.json +2 -3
package/History.md
CHANGED
|
@@ -1,3 +1,45 @@
|
|
|
1
|
+
5.13.0 / 2021-06-28
|
|
2
|
+
===================
|
|
3
|
+
* feat(query): add sanitizeProjection option to opt in to automatically sanitizing untrusted query projections #10243
|
|
4
|
+
* feat(model): add `bulkSave()` function that saves multiple docs in 1 `bulkWrite()` #9727 #9673 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
|
|
5
|
+
* feat(document): allow passing a list of virtuals or `pathsToSkip` to apply in `toObject()` and `toJSON()` #10120
|
|
6
|
+
* fix(model): make Model.validate use object under validation as context by default #10360 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
|
|
7
|
+
* feat(document): add support for pathsToSkip in validate and validateSync #10375 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
|
|
8
|
+
* feat(model): add `diffIndexes()` function that calculates what indexes `syncIndexes()` will create/drop without actually executing any changes #10362 [IslandRhythms](https://github.com/IslandRhythms)
|
|
9
|
+
* feat(document): avoid using sessions that have ended, so you can use documents that were loaded in the session after calling `endSession()` #10306
|
|
10
|
+
|
|
11
|
+
5.12.15 / 2021-06-25
|
|
12
|
+
====================
|
|
13
|
+
* fix(index.d.ts): add extra TInstanceMethods generic param to `Schema` for cases when we can't infer from Model #10358
|
|
14
|
+
* fix(index.d.ts): added typings for near() in model aggregation #10373 [tbhaxor](https://github.com/tbhaxor)
|
|
15
|
+
* fix(index.d.ts): correct function signature for `Query#cast()` #10388 [lkho](https://github.com/lkho)
|
|
16
|
+
* docs(transactions): add import statement #10365 [JimLynchCodes](https://github.com/JimLynchCodes)
|
|
17
|
+
* docs(schema): add missing `discriminatorKey` schema option #10386 #10376 [IslandRhythms](https://github.com/IslandRhythms)
|
|
18
|
+
* docs(index.d.ts): fix typo #10363 [houssemchebeb](https://github.com/houssemchebeb)
|
|
19
|
+
|
|
20
|
+
5.12.14 / 2021-06-15
|
|
21
|
+
====================
|
|
22
|
+
* fix(schema): check that schema type is an object when setting isUnderneathDocArray #10361 [vmo-khanus](https://github.com/vmo-khanus)
|
|
23
|
+
* fix(document): avoid infinite recursion when setting single nested subdoc to array #10351
|
|
24
|
+
* fix(populate): allow populating nested path in schema using `Model.populate()` #10335
|
|
25
|
+
* fix(drivers): emit operation-start/operation-end events to allow inspecting when operations start and end
|
|
26
|
+
* fix(index.d.ts): improve typings for virtuals #10350 [thiagokisaki](https://github.com/thiagokisaki)
|
|
27
|
+
* fix(index.d.ts): correct constructor type for Document #10328
|
|
28
|
+
* fix(index.d.ts): add `ValidationError` as a possible type for `ValidationError#errors` #10320 [IslandRhythms](https://github.com/IslandRhythms)
|
|
29
|
+
* fix: remove unnecessary async devDependency that's causing npm audit warnings #10281
|
|
30
|
+
* docs(typescript): add schemas guide #10308
|
|
31
|
+
* docs(model): add options parameter description to `Model.exists()` #10336 [Aminoiz](https://github.com/Aminoiz)
|
|
32
|
+
|
|
33
|
+
5.12.13 / 2021-06-04
|
|
34
|
+
====================
|
|
35
|
+
* perf(document): avoid creating nested paths when running `$getAllSubdocs()` #10275
|
|
36
|
+
* fix: make returnDocument option work with `findOneAndUpdate()` #10232 #10231 [cnwangjie](https://github.com/cnwangjie)
|
|
37
|
+
* fix(document): correctly reset subdocument when resetting a map subdocument underneath a single nested subdoc after save #10295
|
|
38
|
+
* perf(query): avoid setting non-null sessions to avoid overhead from $getAllSubdocs() #10275
|
|
39
|
+
* perf(document): pre split schematype paths when compiling schema to avoid extra overhead of splitting when hydrating documents #10275
|
|
40
|
+
* perf(schema): pre-calculate mapPaths to avoid looping over every path for each path when initing doc #10275
|
|
41
|
+
* fix(index.d.ts): drill down into nested arrays when creating LeanDocument type #10293
|
|
42
|
+
|
|
1
43
|
5.12.12 / 2021-05-28
|
|
2
44
|
====================
|
|
3
45
|
* fix(documentarray): retain atomics when setting to a new array #10272
|