mongoose 6.2.11 → 6.3.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.
Files changed (49) hide show
  1. package/.eslintrc.json +157 -157
  2. package/README.md +1 -1
  3. package/dist/browser.umd.js +2 -1704
  4. package/lib/aggregate.js +4 -3
  5. package/lib/collection.js +0 -7
  6. package/lib/connection.js +2 -1
  7. package/lib/cursor/ChangeStream.js +42 -2
  8. package/lib/cursor/QueryCursor.js +2 -0
  9. package/lib/document.js +22 -26
  10. package/lib/error/cast.js +8 -2
  11. package/lib/error/eachAsyncMultiError.js +41 -0
  12. package/lib/helpers/common.js +0 -8
  13. package/lib/helpers/cursor/eachAsync.js +44 -12
  14. package/lib/helpers/immediate.js +3 -1
  15. package/lib/helpers/isAsyncFunction.js +19 -7
  16. package/lib/helpers/model/discriminator.js +1 -3
  17. package/lib/helpers/populate/getModelsMapForPopulate.js +13 -10
  18. package/lib/helpers/query/applyGlobalOption.js +29 -0
  19. package/lib/helpers/schematype/handleImmutable.js +4 -1
  20. package/lib/helpers/timestamps/setupTimestamps.js +2 -2
  21. package/lib/index.js +11 -4
  22. package/lib/internal.js +0 -1
  23. package/lib/model.js +39 -27
  24. package/lib/query.js +23 -4
  25. package/lib/queryhelpers.js +11 -1
  26. package/lib/schema/SubdocumentPath.js +3 -15
  27. package/lib/schema/documentarray.js +7 -7
  28. package/lib/schema/number.js +1 -5
  29. package/lib/schema/objectid.js +2 -4
  30. package/lib/schema/string.js +1 -5
  31. package/lib/schema.js +115 -2
  32. package/lib/schematype.js +2 -2
  33. package/lib/types/DocumentArray/methods/index.js +9 -1
  34. package/lib/types/array/methods/index.js +8 -9
  35. package/lib/validoptions.js +1 -0
  36. package/package.json +25 -18
  37. package/tools/repl.js +2 -1
  38. package/tsconfig.json +2 -2
  39. package/types/aggregate.d.ts +1 -2
  40. package/types/connection.d.ts +4 -5
  41. package/types/cursor.d.ts +13 -6
  42. package/types/document.d.ts +17 -14
  43. package/types/error.d.ts +124 -124
  44. package/types/index.d.ts +350 -202
  45. package/types/mongooseoptions.d.ts +11 -6
  46. package/types/schemaoptions.d.ts +1 -2
  47. package/CHANGELOG.md +0 -7238
  48. package/History.md +0 -1
  49. package/lib/helpers/query/applyGlobalMaxTimeMS.js +0 -15
@@ -1,17 +1,22 @@
1
- import stream = require('stream');
2
-
3
1
  declare module 'mongoose' {
2
+ import stream = require('stream');
4
3
 
5
4
  interface MongooseOptions {
6
5
  /**
7
- * Set to false to skip applying global plugins to child schemas.
6
+ * Set to `true` to set `allowDiskUse` to true to all aggregation operations by default.
7
+ *
8
+ * @default false
9
+ */
10
+ allowDiskUse?: boolean;
11
+ /**
12
+ * Set to `false` to skip applying global plugins to child schemas.
8
13
  *
9
14
  * @default true
10
15
  */
11
16
  applyPluginsToChildSchemas?: boolean;
12
17
 
13
18
  /**
14
- * Set to true to apply global plugins to discriminator schemas.
19
+ * Set to `true` to apply global plugins to discriminator schemas.
15
20
  * This typically isn't necessary because plugins are applied to the base schema and
16
21
  * discriminators copy all middleware, methods, statics, and properties from the base schema.
17
22
  *
@@ -20,7 +25,7 @@ declare module 'mongoose' {
20
25
  applyPluginsToDiscriminators?: boolean;
21
26
 
22
27
  /**
23
- * autoCreate is true by default unless readPreference is secondary or secondaryPreferred,
28
+ * autoCreate is `true` by default unless readPreference is secondary or secondaryPreferred,
24
29
  * which means Mongoose will attempt to create every model's underlying collection before
25
30
  * creating indexes. If readPreference is secondary or secondaryPreferred, Mongoose will
26
31
  * default to false for both autoCreate and autoIndex because both createCollection() and
@@ -29,7 +34,7 @@ declare module 'mongoose' {
29
34
  autoCreate?: boolean;
30
35
 
31
36
  /**
32
- * Set to false to disable automatic index creation for all models associated with this Mongoose instance.
37
+ * Set to `false` to disable automatic index creation for all models associated with this Mongoose instance.
33
38
  *
34
39
  * @default true
35
40
  */
@@ -1,6 +1,5 @@
1
- import mongodb = require('mongodb');
2
-
3
1
  declare module 'mongoose' {
2
+ import mongodb = require('mongodb');
4
3
 
5
4
  interface SchemaTimestampsConfig {
6
5
  createdAt?: boolean | string;