mongoose 5.12.15 → 5.13.3
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 +43 -0
- package/dist/browser.umd.js +57 -50
- package/index.d.ts +160 -138
- package/lib/document.js +80 -32
- package/lib/helpers/model/discriminator.js +5 -8
- package/lib/helpers/query/sanitizeProjection.js +14 -0
- package/lib/helpers/update/applyTimestampsToChildren.js +35 -28
- package/lib/model.js +206 -8
- package/lib/query.js +22 -2
- package/lib/schema/array.js +4 -2
- package/lib/schema.js +11 -9
- package/lib/validoptions.js +1 -0
- package/package.json +5 -3
package/History.md
CHANGED
|
@@ -1,3 +1,46 @@
|
|
|
1
|
+
5.13.3 / 2021-07-16
|
|
2
|
+
===================
|
|
3
|
+
* fix(model): avoid throwing error when bulkSave() called on a document with no changes #10437
|
|
4
|
+
* fix(timestamps): apply timestamps when creating new subdocs with `$addToSet` and with positional operator #10447
|
|
5
|
+
* fix(schema): allow calling Schema#loadClass() with class that has a static getter with no setter #10436
|
|
6
|
+
* fix(model): handle re-applying object defaults after explicitly unsetting #10442 [semirturgay](https://github.com/semirturgay)
|
|
7
|
+
* fix: bump mongodb driver -> 3.6.10 #10440 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
|
|
8
|
+
* fix(index.d.ts): consistently use NativeDate instead of Date for Date validators and timestamps functions #10426
|
|
9
|
+
* fix(index.d.ts): allow calling `discriminator()` with non-document #10452 #10421 [DouglasGabr](https://github.com/DouglasGabr)
|
|
10
|
+
* fix(index.d.ts): allow passing ResultType generic to Schema#path() #10435
|
|
11
|
+
|
|
12
|
+
5.13.2 / 2021-07-03
|
|
13
|
+
===================
|
|
14
|
+
* fix: hardcode @types/node version for now to avoid breaking changes from DefinitelyTyped/DefinitelyTyped#53669 #10415
|
|
15
|
+
* fix(index.d.ts): allow using type: Date with Date paths in SchemaDefinitionType #10409
|
|
16
|
+
* fix(index.d.ts): allow extra VirtualTypeOptions for better plugin support #10412
|
|
17
|
+
* docs(api): add SchemaArray to docs #10397
|
|
18
|
+
* docs(schema+validation): fix broken links #10396
|
|
19
|
+
* docs(transactions): add note about creating a connection to transactions docs #10406
|
|
20
|
+
|
|
21
|
+
5.13.1 / 2021-07-02
|
|
22
|
+
===================
|
|
23
|
+
* fix(discriminator): allow using array as discriminator key in schema and as tied value #10303
|
|
24
|
+
* fix(index.d.ts): allow using & Document in schema definition for required subdocument arrays #10370
|
|
25
|
+
* fix(index.d.ts): if using DocType that doesn't extends Document, default to returning that DocType from `toObject()` and `toJSON()` #10345
|
|
26
|
+
* fix(index.d.ts): use raw DocType instead of LeanDocument when using `lean()` with queries if raw DocType doesn't `extends Document` #10345
|
|
27
|
+
* fix(index.d.ts): remove err: any in callbacks, use `err: CallbackError` instead #10340
|
|
28
|
+
* fix(index.d.ts): allow defining map of schemas in TypeScript #10389
|
|
29
|
+
* fix(index.d.ts): correct return type for Model.createCollection() #10359
|
|
30
|
+
* docs(promises+discriminators): correctly escape () in regexp to pull in examples correctly #10364
|
|
31
|
+
* docs(update): fix outdated URL about unindexed upsert #10406 [grimmer0125](https://github.com/grimmer0125)
|
|
32
|
+
* docs(index.d.ts): proper placement of mongoose.Date JSDoc [thiagokisaki](https://github.com/thiagokisaki)
|
|
33
|
+
|
|
34
|
+
5.13.0 / 2021-06-28
|
|
35
|
+
===================
|
|
36
|
+
* feat(query): add sanitizeProjection option to opt in to automatically sanitizing untrusted query projections #10243
|
|
37
|
+
* feat(model): add `bulkSave()` function that saves multiple docs in 1 `bulkWrite()` #9727 #9673 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
|
|
38
|
+
* feat(document): allow passing a list of virtuals or `pathsToSkip` to apply in `toObject()` and `toJSON()` #10120
|
|
39
|
+
* fix(model): make Model.validate use object under validation as context by default #10360 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
|
|
40
|
+
* feat(document): add support for pathsToSkip in validate and validateSync #10375 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
|
|
41
|
+
* feat(model): add `diffIndexes()` function that calculates what indexes `syncIndexes()` will create/drop without actually executing any changes #10362 [IslandRhythms](https://github.com/IslandRhythms)
|
|
42
|
+
* feat(document): avoid using sessions that have ended, so you can use documents that were loaded in the session after calling `endSession()` #10306
|
|
43
|
+
|
|
1
44
|
5.12.15 / 2021-06-25
|
|
2
45
|
====================
|
|
3
46
|
* fix(index.d.ts): add extra TInstanceMethods generic param to `Schema` for cases when we can't infer from Model #10358
|