mongoose 6.2.6 → 6.2.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/.eslintrc.json +35 -26
- package/CHANGELOG.md +30 -0
- package/dist/browser.umd.js +83 -75
- package/lib/browserDocument.js +1 -0
- package/lib/connection.js +4 -4
- package/lib/cursor/AggregationCursor.js +0 -1
- package/lib/cursor/QueryCursor.js +2 -1
- package/lib/document.js +49 -11
- package/lib/helpers/document/handleSpreadDoc.js +19 -1
- package/lib/helpers/query/castFilterPath.js +0 -1
- package/lib/index.js +1 -3
- package/lib/model.js +78 -67
- package/lib/options/SchemaDateOptions.js +8 -1
- package/lib/query.js +41 -13
- package/lib/queryhelpers.js +17 -0
- package/lib/schema/SubdocumentPath.js +4 -1
- package/lib/schema/array.js +1 -0
- package/lib/schema/documentarray.js +14 -7
- package/lib/schema.js +14 -4
- package/lib/schematype.js +3 -1
- package/lib/types/array/methods/index.js +2 -0
- package/lib/virtualtype.js +1 -0
- package/package.json +12 -11
- package/tools/repl.js +8 -8
- package/tools/sharded.js +3 -3
- package/types/connection.d.ts +116 -116
- package/types/document.d.ts +3 -0
- package/types/error.d.ts +2 -2
- package/types/index.d.ts +73 -178
- package/types/mongooseoptions.d.ts +180 -0
- package/types/pipelinestage.d.ts +194 -194
- package/types/schemaoptions.d.ts +8 -2
package/.eslintrc.json
CHANGED
|
@@ -4,34 +4,43 @@
|
|
|
4
4
|
],
|
|
5
5
|
"ignorePatterns": [
|
|
6
6
|
"docs",
|
|
7
|
-
"tools",
|
|
8
7
|
"dist",
|
|
9
|
-
"
|
|
10
|
-
"test/files/*",
|
|
11
|
-
"benchmarks"
|
|
8
|
+
"test/files/*"
|
|
12
9
|
],
|
|
13
|
-
"overrides": [
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
10
|
+
"overrides": [{
|
|
11
|
+
"files": [
|
|
12
|
+
"**/*.{ts,tsx}"
|
|
13
|
+
],
|
|
14
|
+
"extends": [
|
|
15
|
+
"plugin:@typescript-eslint/eslint-recommended",
|
|
16
|
+
"plugin:@typescript-eslint/recommended"
|
|
17
|
+
],
|
|
18
|
+
"plugins": [
|
|
19
|
+
"@typescript-eslint"
|
|
20
|
+
],
|
|
21
|
+
"rules": {
|
|
22
|
+
"@typescript-eslint/triple-slash-reference": "off",
|
|
23
|
+
"spaced-comment": ["error", "always", {
|
|
24
|
+
"markers": ["/"]
|
|
25
|
+
}],
|
|
26
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
27
|
+
"@typescript-eslint/ban-types": "off",
|
|
28
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
29
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
30
|
+
"@typescript-eslint/indent": ["error", 2, {
|
|
31
|
+
"SwitchCase": 1
|
|
32
|
+
}],
|
|
33
|
+
"@typescript-eslint/prefer-optional-chain": "error",
|
|
34
|
+
"@typescript-eslint/brace-style": "error",
|
|
35
|
+
"@typescript-eslint/no-dupe-class-members": "error",
|
|
36
|
+
"@typescript-eslint/no-redeclare": "error",
|
|
37
|
+
"@typescript-eslint/type-annotation-spacing": "error",
|
|
38
|
+
"@typescript-eslint/object-curly-spacing": ["error", "always"],
|
|
39
|
+
"@typescript-eslint/semi": "error",
|
|
40
|
+
"@typescript-eslint/space-before-function-paren": ["error", "never"],
|
|
41
|
+
"@typescript-eslint/space-infix-ops": "error"
|
|
33
42
|
}
|
|
34
|
-
],
|
|
43
|
+
}],
|
|
35
44
|
"plugins": [
|
|
36
45
|
"mocha-no-only"
|
|
37
46
|
],
|
|
@@ -151,4 +160,4 @@
|
|
|
151
160
|
],
|
|
152
161
|
"no-empty": "off"
|
|
153
162
|
}
|
|
154
|
-
}
|
|
163
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
6.2.9 / 2022-03-28
|
|
2
|
+
==================
|
|
3
|
+
* perf(document+model): make a few small optimizations #11380
|
|
4
|
+
* fix(types): improve populate return type #11560 [mohammad0-0ahmad](https://github.com/mohammad0-0ahmad)
|
|
5
|
+
* fix(document): avoid marking paths as modified on subdocument defaults #11528
|
|
6
|
+
* docs(schema): add example to index `expires` option #11557 [boly38](https://github.com/boly38)
|
|
7
|
+
* docs(model): add change stream docs #11275
|
|
8
|
+
* docs(lambda): update Lambda docs for Mongoose 6 #11275
|
|
9
|
+
* docs(connections): add note about connecting with X509 #11333
|
|
10
|
+
* docs(populate): fix incorrect path name in `refPath` example #11565 [chandiwalaaadhar](https://github.com/chandiwalaaadhar)
|
|
11
|
+
|
|
12
|
+
6.2.8 / 2022-03-22
|
|
13
|
+
==================
|
|
14
|
+
* fix(document): handle casting array of spread docs #11522
|
|
15
|
+
* fix(document): avoid setting nested properties on top-level document when initing with strict: false #11526
|
|
16
|
+
* fix(document): correctly handle deeply nested subdocuments when getting paths to validate #11501
|
|
17
|
+
* fix(types): avoid making TInstanceMethods any by default leading to `this = any` in middleware #11435
|
|
18
|
+
* fix(types): allow defining array default if using Types.Array<> in document interface #11391
|
|
19
|
+
* docs(migrating_to_6): describe breaking change in Mongoose 6 about default query populate model #11289
|
|
20
|
+
* docs(middleware): fix typo #11537 [x1489](https://github.com/x1489)
|
|
21
|
+
|
|
22
|
+
6.2.7 / 2022-03-16
|
|
23
|
+
==================
|
|
24
|
+
* perf(document): avoid running validation on every array element if there's no validators to run #11380
|
|
25
|
+
* fix(cursor): correctly populate in batches when batchSize is set #11509
|
|
26
|
+
* fix(connection): avoid setting MongoClient on useDb() connections until after setting on base connection #11445
|
|
27
|
+
* fix(schema): throw more helpful error when using schema from a different version of Mongoose module #10453
|
|
28
|
+
* fix: add missing timeseries expiration handling #11489 #11229 [Uzlopak](https://github.com/Uzlopak)
|
|
29
|
+
* docs: correct Model.findOneAndReplace docs param naming #11524 [anatolykopyl](https://github.com/anatolykopyl)
|
|
30
|
+
|
|
1
31
|
6.2.6 / 2022-03-11
|
|
2
32
|
==================
|
|
3
33
|
* fix(types): correct reference to cursor TypeScript bindings #11513 [SimonHausdorf](https://github.com/SimonHausdorf)
|