mongoose 6.2.8 → 6.2.11

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.
Files changed (61) hide show
  1. package/.eslintrc.json +35 -26
  2. package/CHANGELOG.md +28 -0
  3. package/dist/browser.umd.js +38 -27
  4. package/lib/aggregate.js +57 -66
  5. package/lib/browser.js +4 -4
  6. package/lib/connection.js +21 -21
  7. package/lib/cursor/AggregationCursor.js +2 -2
  8. package/lib/cursor/QueryCursor.js +3 -3
  9. package/lib/document.js +65 -49
  10. package/lib/error/index.js +2 -2
  11. package/lib/helpers/indexes/applySchemaCollation.js +13 -0
  12. package/lib/helpers/indexes/isTextIndex.js +16 -0
  13. package/lib/helpers/populate/markArraySubdocsPopulated.js +1 -1
  14. package/lib/helpers/projection/hasIncludedChildren.js +1 -1
  15. package/lib/helpers/query/castUpdate.js +3 -1
  16. package/lib/helpers/update/applyTimestampsToChildren.js +2 -2
  17. package/lib/helpers/update/applyTimestampsToUpdate.js +0 -1
  18. package/lib/index.js +24 -26
  19. package/lib/model.js +144 -146
  20. package/lib/options/SchemaArrayOptions.js +2 -2
  21. package/lib/options/SchemaBufferOptions.js +1 -1
  22. package/lib/options/SchemaDateOptions.js +9 -2
  23. package/lib/options/SchemaDocumentArrayOptions.js +3 -3
  24. package/lib/options/SchemaMapOptions.js +2 -2
  25. package/lib/options/SchemaNumberOptions.js +3 -3
  26. package/lib/options/SchemaObjectIdOptions.js +2 -2
  27. package/lib/options/SchemaStringOptions.js +1 -1
  28. package/lib/options/SchemaSubdocumentOptions.js +2 -2
  29. package/lib/options/SchemaTypeOptions.js +3 -3
  30. package/lib/query.js +291 -248
  31. package/lib/schema/SubdocumentPath.js +4 -3
  32. package/lib/schema/array.js +2 -2
  33. package/lib/schema/boolean.js +4 -4
  34. package/lib/schema/buffer.js +3 -3
  35. package/lib/schema/date.js +7 -7
  36. package/lib/schema/decimal128.js +2 -2
  37. package/lib/schema/documentarray.js +3 -3
  38. package/lib/schema/mixed.js +2 -2
  39. package/lib/schema/number.js +6 -6
  40. package/lib/schema/objectid.js +4 -7
  41. package/lib/schema/string.js +38 -16
  42. package/lib/schema.js +30 -29
  43. package/lib/schematype.js +78 -69
  44. package/lib/types/ArraySubdocument.js +1 -1
  45. package/lib/types/DocumentArray/methods/index.js +2 -2
  46. package/lib/types/array/index.js +1 -1
  47. package/lib/types/array/methods/index.js +13 -13
  48. package/lib/types/buffer.js +1 -1
  49. package/lib/types/decimal128.js +1 -1
  50. package/lib/types/objectid.js +1 -1
  51. package/lib/types/subdocument.js +31 -2
  52. package/lib/virtualtype.js +3 -3
  53. package/package.json +18 -16
  54. package/tools/repl.js +8 -8
  55. package/tools/sharded.js +3 -3
  56. package/types/aggregate.d.ts +223 -0
  57. package/types/connection.d.ts +116 -116
  58. package/types/error.d.ts +2 -2
  59. package/types/index.d.ts +76 -213
  60. package/types/pipelinestage.d.ts +194 -194
  61. package/types/schemaoptions.d.ts +2 -2
package/.eslintrc.json CHANGED
@@ -4,34 +4,43 @@
4
4
  ],
5
5
  "ignorePatterns": [
6
6
  "docs",
7
- "tools",
8
7
  "dist",
9
- "website.js",
10
- "test/files/*",
11
- "benchmarks"
8
+ "test/files/*"
12
9
  ],
13
- "overrides": [
14
- {
15
- "files": [
16
- "**/*.{ts,tsx}"
17
- ],
18
- "extends": [
19
- "plugin:@typescript-eslint/eslint-recommended",
20
- "plugin:@typescript-eslint/recommended"
21
- ],
22
- "plugins": [
23
- "@typescript-eslint"
24
- ],
25
- "rules": {
26
- "@typescript-eslint/triple-slash-reference": "off",
27
- "spaced-comment": ["error", "always", { "markers": ["/"] }],
28
- "@typescript-eslint/no-explicit-any": "off",
29
- "@typescript-eslint/ban-types": "off",
30
- "@typescript-eslint/no-unused-vars": "off",
31
- "@typescript-eslint/explicit-module-boundary-types": "off"
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,31 @@
1
+ 6.2.11 / 2022-04-13
2
+ ===================
3
+ * fix(document): handle validation with triply nested document arrays #11564
4
+ * fix(query): skip applying string schema setters on $regex #11426
5
+ * fix: skip findOneAndReplace() validation if runValidators = false #11559
6
+ * fix(model): correctly handle schema-level collations in syncIndexes() #7621
7
+ * fix(types): correct populate query return type with lean #11560 [mohammad0-0ahmad](https://github.com/mohammad0-0ahmad)
8
+ * fix(types): allow using { type: Mixed } as schema type definition for any path #10900
9
+ * docs: fix example on Schema.prototype.post() #11648 [EmilienLeroy](https://github.com/EmilienLeroy)
10
+ * docs: fix typo in methods/index.js #11651 [eltociear](https://github.com/eltociear)
11
+
12
+ 6.2.10 / 2022-04-04
13
+ ===================
14
+ * fix(types): improve lastErrorObject typing for rawResults #11602 [simllll](https://github.com/simllll)
15
+ * docs(typescript): add note about deprecating extends Document #11619 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
16
+ * docs: consistent syntax highlighting with upgraded highlight.js #11579 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
17
+
18
+ 6.2.9 / 2022-03-28
19
+ ==================
20
+ * perf(document+model): make a few small optimizations #11380
21
+ * fix(types): improve populate return type #11560 [mohammad0-0ahmad](https://github.com/mohammad0-0ahmad)
22
+ * fix(document): avoid marking paths as modified on subdocument defaults #11528
23
+ * docs(schema): add example to index `expires` option #11557 [boly38](https://github.com/boly38)
24
+ * docs(model): add change stream docs #11275
25
+ * docs(lambda): update Lambda docs for Mongoose 6 #11275
26
+ * docs(connections): add note about connecting with X509 #11333
27
+ * docs(populate): fix incorrect path name in `refPath` example #11565 [chandiwalaaadhar](https://github.com/chandiwalaaadhar)
28
+
1
29
  6.2.8 / 2022-03-22
2
30
  ==================
3
31
  * fix(document): handle casting array of spread docs #11522