mongoose 6.2.10 → 6.3.1
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 +157 -157
- package/dist/browser.umd.js +2 -1693
- package/lib/aggregate.js +23 -31
- package/lib/collection.js +0 -7
- package/lib/cursor/ChangeStream.js +42 -2
- package/lib/cursor/QueryCursor.js +2 -0
- package/lib/document.js +13 -19
- package/lib/error/cast.js +7 -2
- package/lib/error/eachAsyncMultiError.js +41 -0
- package/lib/helpers/cursor/eachAsync.js +44 -12
- package/lib/helpers/indexes/applySchemaCollation.js +13 -0
- package/lib/helpers/indexes/isTextIndex.js +16 -0
- package/lib/helpers/model/discriminator.js +1 -3
- package/lib/helpers/populate/getModelsMapForPopulate.js +13 -10
- package/lib/helpers/query/applyGlobalOption.js +29 -0
- package/lib/helpers/query/castUpdate.js +3 -1
- package/lib/helpers/schematype/handleImmutable.js +4 -1
- package/lib/helpers/timestamps/setupTimestamps.js +2 -2
- package/lib/helpers/update/applyTimestampsToChildren.js +2 -2
- package/lib/helpers/update/applyTimestampsToUpdate.js +0 -1
- package/lib/index.js +11 -4
- package/lib/model.js +36 -36
- package/lib/query.js +59 -26
- package/lib/queryhelpers.js +11 -1
- package/lib/schema/SubdocumentPath.js +2 -1
- package/lib/schema/documentarray.js +2 -4
- package/lib/schema/objectid.js +0 -3
- package/lib/schema/string.js +24 -2
- package/lib/schema.js +117 -3
- package/lib/schematype.js +2 -3
- package/lib/types/DocumentArray/methods/index.js +1 -1
- package/lib/types/array/methods/index.js +9 -10
- package/lib/types/subdocument.js +29 -0
- package/lib/validoptions.js +1 -0
- package/package.json +13 -7
- package/tools/repl.js +2 -1
- package/tsconfig.json +2 -1
- package/types/aggregate.d.ts +223 -0
- package/types/connection.d.ts +2 -2
- package/types/cursor.d.ts +10 -4
- package/types/document.d.ts +3 -3
- package/types/index.d.ts +200 -215
- package/types/mongooseoptions.d.ts +10 -4
- package/CHANGELOG.md +0 -7227
- package/History.md +0 -1
- package/lib/helpers/query/applyGlobalMaxTimeMS.js +0 -15
|
@@ -4,14 +4,20 @@ declare module 'mongoose' {
|
|
|
4
4
|
|
|
5
5
|
interface MongooseOptions {
|
|
6
6
|
/**
|
|
7
|
-
* Set to
|
|
7
|
+
* Set to `true` to set `allowDiskUse` to true to all aggregation operations by default.
|
|
8
|
+
*
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
allowDiskUse?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Set to `false` to skip applying global plugins to child schemas.
|
|
8
14
|
*
|
|
9
15
|
* @default true
|
|
10
16
|
*/
|
|
11
17
|
applyPluginsToChildSchemas?: boolean;
|
|
12
18
|
|
|
13
19
|
/**
|
|
14
|
-
* Set to true to apply global plugins to discriminator schemas.
|
|
20
|
+
* Set to `true` to apply global plugins to discriminator schemas.
|
|
15
21
|
* This typically isn't necessary because plugins are applied to the base schema and
|
|
16
22
|
* discriminators copy all middleware, methods, statics, and properties from the base schema.
|
|
17
23
|
*
|
|
@@ -20,7 +26,7 @@ declare module 'mongoose' {
|
|
|
20
26
|
applyPluginsToDiscriminators?: boolean;
|
|
21
27
|
|
|
22
28
|
/**
|
|
23
|
-
* autoCreate is true by default unless readPreference is secondary or secondaryPreferred,
|
|
29
|
+
* autoCreate is `true` by default unless readPreference is secondary or secondaryPreferred,
|
|
24
30
|
* which means Mongoose will attempt to create every model's underlying collection before
|
|
25
31
|
* creating indexes. If readPreference is secondary or secondaryPreferred, Mongoose will
|
|
26
32
|
* default to false for both autoCreate and autoIndex because both createCollection() and
|
|
@@ -29,7 +35,7 @@ declare module 'mongoose' {
|
|
|
29
35
|
autoCreate?: boolean;
|
|
30
36
|
|
|
31
37
|
/**
|
|
32
|
-
* Set to false to disable automatic index creation for all models associated with this Mongoose instance.
|
|
38
|
+
* Set to `false` to disable automatic index creation for all models associated with this Mongoose instance.
|
|
33
39
|
*
|
|
34
40
|
* @default true
|
|
35
41
|
*/
|