mongoose 6.1.5 → 6.1.9
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/CHANGELOG.md +52 -0
- package/dist/browser.umd.js +203 -206
- package/index.d.ts +36 -19
- package/lib/aggregate.js +33 -19
- package/lib/cast/objectid.js +1 -2
- package/lib/cast.js +19 -13
- package/lib/connection.js +4 -0
- package/lib/document.js +55 -29
- package/lib/drivers/node-mongodb-native/collection.js +1 -2
- package/lib/helpers/document/compile.js +6 -2
- package/lib/helpers/path/setDottedPath.js +7 -3
- package/lib/helpers/populate/getModelsMapForPopulate.js +2 -2
- package/lib/helpers/populate/modelNamesFromRefPath.js +2 -2
- package/lib/helpers/setDefaultsOnInsert.js +16 -7
- package/lib/helpers/update/applyTimestampsToChildren.js +2 -2
- package/lib/helpers/update/applyTimestampsToUpdate.js +1 -1
- package/lib/helpers/update/castArrayFilters.js +1 -1
- package/lib/helpers/update/updatedPathsByArrayFilter.js +1 -1
- package/lib/index.js +8 -37
- package/lib/model.js +13 -12
- package/lib/query.js +16 -16
- package/lib/schema/SubdocumentPath.js +1 -1
- package/lib/schema/array.js +1 -1
- package/lib/schema/documentarray.js +2 -2
- package/lib/schema.js +25 -21
- package/lib/schematype.js +2 -2
- package/lib/statemachine.js +4 -5
- package/lib/types/ArraySubdocument.js +14 -6
- package/lib/types/subdocument.js +2 -1
- package/lib/utils.js +5 -19
- package/package.json +17 -13
- package/tools/repl.js +21 -23
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,55 @@
|
|
|
1
|
+
6.1.9 / 2022-01-31
|
|
2
|
+
==================
|
|
3
|
+
* fix(query): respect nested schema strict as default when casting query filters #11291
|
|
4
|
+
* fix(mongoose): make isValidObjectId() consistent with isValid(), make `ObjectId()` casting more flexible #11209
|
|
5
|
+
* fix(setDefaultsOnInsert): ignore defaults underneath maps #11235
|
|
6
|
+
* fix(query): avoid setting nested schema properties that are stripped out by strictQuery to undefined in query filter #11291
|
|
7
|
+
* fix: check for all flags in a regex deepequal #11242 [Uzlopak](https://github.com/Uzlopak)
|
|
8
|
+
* fix: replace substr with substring #11278 [Uzlopak](https://github.com/Uzlopak)
|
|
9
|
+
* docs: port for documentation testing in CONTRIBUTING.md #11273 [Uzlopak](https://github.com/Uzlopak)
|
|
10
|
+
|
|
11
|
+
6.1.8 / 2022-01-24
|
|
12
|
+
==================
|
|
13
|
+
* fix(connection): stop leaking sessions in .transaction() #11259 #11256 [Uzlopak](https://github.com/Uzlopak)
|
|
14
|
+
* perf: remove sliced in favor of Array.prototype.slice() #11238 [Uzlopak](https://github.com/Uzlopak)
|
|
15
|
+
* perf: improve setDottedPath #11264 [Uzlopak](https://github.com/Uzlopak)
|
|
16
|
+
* fix(document): handle edge case where NestJS sets String.type = String, mixing up schema definitions #11199
|
|
17
|
+
* fix: remove obsolete code after upgrading to bson4 #11265 [Uzlopak](https://github.com/Uzlopak)
|
|
18
|
+
* fix: remove util.isArray in favor of Array.isArray #11234 [Uzlopak](https://github.com/Uzlopak)
|
|
19
|
+
* fix(index.d.ts): avoid UnpackedIntersection making `findOne().populate()` result non-nullable #11041
|
|
20
|
+
* docs(migration): add note to change default functions to schema #11245 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
|
|
21
|
+
* docs: updated docs and issue templates for new FAQs #11171 [IslandRhythms](https://github.com/IslandRhythms)
|
|
22
|
+
* chore: fix casting benchmark #11262 [Uzlopak](https://github.com/Uzlopak)
|
|
23
|
+
* chore: add mongodb-memory-server to test easier locally #11255 [Uzlopak](https://github.com/Uzlopak)
|
|
24
|
+
* chore: fix testing tsconfig #11243 [Uzlopak](https://github.com/Uzlopak)
|
|
25
|
+
* refactor: move utils.random to test folder #11239 [Uzlopak](https://github.com/Uzlopak)
|
|
26
|
+
|
|
27
|
+
6.1.7 / 2022-01-17
|
|
28
|
+
==================
|
|
29
|
+
* fix(model): correct handling for $push on a nested array #11108
|
|
30
|
+
* fix(update): correctly apply timestamps to update pipelines #11151
|
|
31
|
+
* fix(document): correctly handle modifying array subdocument after setting array subdocument to itself #11172
|
|
32
|
+
* fix(index.d.ts): allow passing options to model() in place of removed `skipInit` #11137
|
|
33
|
+
* fix(aggregate): allow passing verbosity to Aggregate.prototype.explain() #11144
|
|
34
|
+
* fix(index.d.ts): avoid TypeScript inferring _id as any type with HydratedDocument #11085
|
|
35
|
+
* docs: fix Node.js Driver compat link #11214 [wesbos](https://github.com/wesbos)
|
|
36
|
+
* docs: remove extraneous backquote #11204 [joebowbeer](https://github.com/joebowbeer)
|
|
37
|
+
|
|
38
|
+
6.1.6 / 2022-01-10
|
|
39
|
+
==================
|
|
40
|
+
* perf(document): delay creating document event emitter until used to improve memory usage, several small improvements to improve initing docs with large arrays #10400
|
|
41
|
+
* fix(model): avoid `bulkSave()` error when `versionKey: false` #11186 #11071 [IslandRhythms](https://github.com/IslandRhythms)
|
|
42
|
+
* fix(model): revert #11079: `findByIdAndUpdate(undefined)` breaking change #11149
|
|
43
|
+
* fix(index.d.ts): support strings in deep populate #11181 [ivalduan](https://github.com/ivalduan)
|
|
44
|
+
* fix(index.d.ts): rename map() -> transform() to line up with change in v6.0 #11161
|
|
45
|
+
* fix(index.d.ts): allow new Model<DocType>(obj) for stricter type checks #11148
|
|
46
|
+
* fix(index.d.ts): make Schema.prototype.pre() and post() generics default to HydratedDocument<DocType> #11180
|
|
47
|
+
* docs: improve autoCreate docs #11116
|
|
48
|
+
* docs(schematype): add missing parameter to example #11185 [kerolloz](https://github.com/kerolloz)
|
|
49
|
+
* docs(connections): use updated link to list of MongoDB Node driver `connect()` options #11184 [splinter](https://github.com/splinter)
|
|
50
|
+
* docs(aggregate): fix formatting #11191 [enieber](https://github.com/enieber)
|
|
51
|
+
* docs: fix broken link #11179 [khairnarsaurabh23](https://github.com/khairnarsaurabh23)
|
|
52
|
+
|
|
1
53
|
6.1.5 / 2022-01-04
|
|
2
54
|
==================
|
|
3
55
|
* perf(index.d.ts): simplify Schema typedef for query helpers and methods to significantly reduce TS compiler overhead #10349
|