mongoose 6.3.9 → 6.4.2
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 +65 -36
- package/dist/browser.umd.js +68579 -2
- package/lib/cast/date.js +1 -1
- package/lib/cast/decimal128.js +1 -1
- package/lib/cast/objectid.js +1 -1
- package/lib/cast.js +1 -1
- package/lib/connection.js +47 -5
- package/lib/document.js +48 -8
- package/lib/drivers/node-mongodb-native/index.js +1 -1
- package/lib/error/parallelValidate.js +1 -1
- package/lib/helpers/aggregate/prepareDiscriminatorPipeline.js +1 -1
- package/lib/helpers/aggregate/stringifyFunctionOperators.js +1 -1
- package/lib/helpers/arrayDepth.js +1 -1
- package/lib/helpers/cursor/eachAsync.js +1 -1
- package/lib/helpers/discriminator/areDiscriminatorValuesEqual.js +1 -1
- package/lib/helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection.js +1 -1
- package/lib/helpers/discriminator/getConstructor.js +1 -1
- package/lib/helpers/discriminator/getDiscriminatorByValue.js +1 -1
- package/lib/helpers/discriminator/getSchemaDiscriminatorByValue.js +1 -1
- package/lib/helpers/document/handleSpreadDoc.js +1 -1
- package/lib/helpers/each.js +1 -1
- package/lib/helpers/get.js +1 -1
- package/lib/helpers/getConstructorName.js +1 -1
- package/lib/helpers/getDefaultBulkwriteResult.js +1 -1
- package/lib/helpers/indexes/applySchemaCollation.js +1 -1
- package/lib/helpers/indexes/decorateDiscriminatorIndexOptions.js +1 -1
- package/lib/helpers/indexes/isDefaultIdIndex.js +1 -1
- package/lib/helpers/indexes/isTextIndex.js +1 -1
- package/lib/helpers/isMongooseObject.js +1 -1
- package/lib/helpers/isObject.js +1 -1
- package/lib/helpers/isPromise.js +1 -1
- package/lib/helpers/model/applyHooks.js +1 -1
- package/lib/helpers/model/applyStaticHooks.js +1 -1
- package/lib/helpers/once.js +1 -1
- package/lib/helpers/path/flattenObjectWithDottedPaths.js +1 -1
- package/lib/helpers/path/parentPaths.js +1 -1
- package/lib/helpers/path/setDottedPath.js +1 -1
- package/lib/helpers/pluralize.js +1 -1
- package/lib/helpers/populate/SkipPopulateValue.js +1 -1
- package/lib/helpers/populate/assignRawDocsToIdStructure.js +1 -1
- package/lib/helpers/populate/assignVals.js +1 -1
- package/lib/helpers/populate/createPopulateQueryFilter.js +1 -1
- package/lib/helpers/populate/getModelsMapForPopulate.js +1 -1
- package/lib/helpers/populate/leanPopulateMap.js +1 -1
- package/lib/helpers/populate/lookupLocalFields.js +1 -1
- package/lib/helpers/populate/markArraySubdocsPopulated.js +1 -1
- package/lib/helpers/populate/modelNamesFromRefPath.js +1 -1
- package/lib/helpers/populate/removeDeselectedForeignField.js +1 -1
- package/lib/helpers/populate/validateRef.js +1 -1
- package/lib/helpers/printJestWarning.js +1 -1
- package/lib/helpers/processConnectionOptions.js +1 -1
- package/lib/helpers/projection/applyProjection.js +1 -1
- package/lib/helpers/projection/hasIncludedChildren.js +1 -1
- package/lib/helpers/projection/parseProjection.js +1 -1
- package/lib/helpers/query/applyGlobalOption.js +1 -1
- package/lib/helpers/query/applyQueryMiddleware.js +1 -1
- package/lib/helpers/query/cast$expr.js +1 -1
- package/lib/helpers/query/castFilterPath.js +1 -1
- package/lib/helpers/query/sanitizeFilter.js +1 -1
- package/lib/helpers/query/sanitizeProjection.js +1 -1
- package/lib/helpers/query/trusted.js +1 -1
- package/lib/helpers/query/validOps.js +1 -1
- package/lib/helpers/query/wrapThunk.js +1 -1
- package/lib/helpers/schema/addAutoId.js +1 -1
- package/lib/helpers/schema/applyPlugins.js +1 -1
- package/lib/helpers/schema/cleanPositionalOperators.js +1 -1
- package/lib/helpers/schema/getKeysInSchemaOrder.js +1 -1
- package/lib/helpers/schema/getPath.js +1 -1
- package/lib/helpers/schema/handleIdOption.js +1 -1
- package/lib/helpers/schema/handleTimestampOption.js +1 -1
- package/lib/helpers/specialProperties.js +1 -1
- package/lib/helpers/symbols.js +1 -1
- package/lib/helpers/timers.js +1 -1
- package/lib/helpers/timestamps/setupTimestamps.js +5 -2
- package/lib/helpers/topology/allServersUnknown.js +1 -1
- package/lib/helpers/topology/isAtlas.js +1 -1
- package/lib/helpers/topology/isSSLError.js +1 -1
- package/lib/helpers/update/applyTimestampsToChildren.js +1 -1
- package/lib/helpers/update/castArrayFilters.js +1 -1
- package/lib/helpers/update/moveImmutableProperties.js +1 -1
- package/lib/helpers/update/removeUnusedArrayFilters.js +1 -1
- package/lib/helpers/update/updatedPathsByArrayFilter.js +1 -1
- package/lib/helpers/updateValidators.js +11 -18
- package/lib/index.js +108 -29
- package/lib/model.js +1 -1
- package/lib/options/PopulateOptions.js +1 -1
- package/lib/options/SchemaArrayOptions.js +1 -1
- package/lib/options/SchemaBufferOptions.js +1 -1
- package/lib/options/SchemaDocumentArrayOptions.js +1 -1
- package/lib/options/SchemaMapOptions.js +1 -1
- package/lib/options/SchemaNumberOptions.js +1 -1
- package/lib/options/SchemaObjectIdOptions.js +1 -1
- package/lib/options/SchemaSubdocumentOptions.js +1 -1
- package/lib/options/SchemaTypeOptions.js +1 -1
- package/lib/options/VirtualOptions.js +1 -1
- package/lib/options/propertyOptions.js +1 -1
- package/lib/options/removeOptions.js +1 -1
- package/lib/options/saveOptions.js +1 -1
- package/lib/plugins/trackTransaction.js +1 -1
- package/lib/query.js +61 -6
- package/lib/queryhelpers.js +5 -0
- package/lib/schema/array.js +1 -1
- package/lib/schema/date.js +2 -2
- package/lib/schema/documentarray.js +10 -0
- package/lib/schema/number.js +2 -2
- package/lib/schema/string.js +2 -2
- package/lib/schema/symbols.js +1 -1
- package/lib/schema.js +6 -7
- package/lib/statemachine.js +13 -0
- package/lib/types/DocumentArray/methods/index.js +1 -1
- package/lib/utils.js +3 -0
- package/lib/validoptions.js +1 -0
- package/package.json +3 -3
- package/tsconfig.json +1 -0
- package/types/collection.d.ts +1 -1
- package/types/connection.d.ts +5 -0
- package/types/document.d.ts +15 -6
- package/types/expressions.d.ts +2882 -0
- package/types/index.d.ts +46 -17
- package/types/{indizes.d.ts → indexes.d.ts} +2 -2
- package/types/inferschematype.d.ts +173 -0
- package/types/middlewares.d.ts +1 -1
- package/types/models.d.ts +86 -71
- package/types/mongooseoptions.d.ts +9 -1
- package/types/pipelinestage.d.ts +76 -80
- package/types/query.d.ts +1 -1
- package/types/schemaoptions.d.ts +22 -4
- package/types/types.d.ts +3 -1
- package/types/utility.d.ts +9 -0
package/.eslintrc.json
CHANGED
|
@@ -4,43 +4,71 @@
|
|
|
4
4
|
],
|
|
5
5
|
"ignorePatterns": [
|
|
6
6
|
"docs",
|
|
7
|
+
"tools",
|
|
7
8
|
"dist",
|
|
8
|
-
"
|
|
9
|
+
"website.js",
|
|
10
|
+
"test/files/*",
|
|
11
|
+
"benchmarks"
|
|
9
12
|
],
|
|
10
|
-
"overrides": [
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
28
|
+
"spaced-comment": [
|
|
29
|
+
"error",
|
|
30
|
+
"always",
|
|
31
|
+
{
|
|
32
|
+
"block": {
|
|
33
|
+
"markers": [
|
|
34
|
+
"!"
|
|
35
|
+
],
|
|
36
|
+
"balanced": true
|
|
37
|
+
},
|
|
38
|
+
"markers": [
|
|
39
|
+
"/"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
44
|
+
"@typescript-eslint/ban-types": "off",
|
|
45
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
46
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
47
|
+
"@typescript-eslint/indent": [
|
|
48
|
+
"error",
|
|
49
|
+
2,
|
|
50
|
+
{
|
|
51
|
+
"SwitchCase": 1
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"@typescript-eslint/prefer-optional-chain": "error",
|
|
55
|
+
"@typescript-eslint/brace-style": "error",
|
|
56
|
+
"@typescript-eslint/no-dupe-class-members": "error",
|
|
57
|
+
"@typescript-eslint/no-redeclare": "error",
|
|
58
|
+
"@typescript-eslint/type-annotation-spacing": "error",
|
|
59
|
+
"@typescript-eslint/object-curly-spacing": [
|
|
60
|
+
"error",
|
|
61
|
+
"always"
|
|
62
|
+
],
|
|
63
|
+
"@typescript-eslint/semi": "error",
|
|
64
|
+
"@typescript-eslint/space-before-function-paren": [
|
|
65
|
+
"error",
|
|
66
|
+
"never"
|
|
67
|
+
],
|
|
68
|
+
"@typescript-eslint/space-infix-ops": "off"
|
|
69
|
+
}
|
|
42
70
|
}
|
|
43
|
-
|
|
71
|
+
],
|
|
44
72
|
"plugins": [
|
|
45
73
|
"mocha-no-only"
|
|
46
74
|
],
|
|
@@ -158,6 +186,7 @@
|
|
|
158
186
|
"mocha-no-only/mocha-no-only": [
|
|
159
187
|
"error"
|
|
160
188
|
],
|
|
161
|
-
"no-empty": "off"
|
|
189
|
+
"no-empty": "off",
|
|
190
|
+
"eol-last": "warn"
|
|
162
191
|
}
|
|
163
|
-
}
|
|
192
|
+
}
|