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.
Files changed (46) hide show
  1. package/.eslintrc.json +157 -157
  2. package/dist/browser.umd.js +2 -1693
  3. package/lib/aggregate.js +23 -31
  4. package/lib/collection.js +0 -7
  5. package/lib/cursor/ChangeStream.js +42 -2
  6. package/lib/cursor/QueryCursor.js +2 -0
  7. package/lib/document.js +13 -19
  8. package/lib/error/cast.js +7 -2
  9. package/lib/error/eachAsyncMultiError.js +41 -0
  10. package/lib/helpers/cursor/eachAsync.js +44 -12
  11. package/lib/helpers/indexes/applySchemaCollation.js +13 -0
  12. package/lib/helpers/indexes/isTextIndex.js +16 -0
  13. package/lib/helpers/model/discriminator.js +1 -3
  14. package/lib/helpers/populate/getModelsMapForPopulate.js +13 -10
  15. package/lib/helpers/query/applyGlobalOption.js +29 -0
  16. package/lib/helpers/query/castUpdate.js +3 -1
  17. package/lib/helpers/schematype/handleImmutable.js +4 -1
  18. package/lib/helpers/timestamps/setupTimestamps.js +2 -2
  19. package/lib/helpers/update/applyTimestampsToChildren.js +2 -2
  20. package/lib/helpers/update/applyTimestampsToUpdate.js +0 -1
  21. package/lib/index.js +11 -4
  22. package/lib/model.js +36 -36
  23. package/lib/query.js +59 -26
  24. package/lib/queryhelpers.js +11 -1
  25. package/lib/schema/SubdocumentPath.js +2 -1
  26. package/lib/schema/documentarray.js +2 -4
  27. package/lib/schema/objectid.js +0 -3
  28. package/lib/schema/string.js +24 -2
  29. package/lib/schema.js +117 -3
  30. package/lib/schematype.js +2 -3
  31. package/lib/types/DocumentArray/methods/index.js +1 -1
  32. package/lib/types/array/methods/index.js +9 -10
  33. package/lib/types/subdocument.js +29 -0
  34. package/lib/validoptions.js +1 -0
  35. package/package.json +13 -7
  36. package/tools/repl.js +2 -1
  37. package/tsconfig.json +2 -1
  38. package/types/aggregate.d.ts +223 -0
  39. package/types/connection.d.ts +2 -2
  40. package/types/cursor.d.ts +10 -4
  41. package/types/document.d.ts +3 -3
  42. package/types/index.d.ts +200 -215
  43. package/types/mongooseoptions.d.ts +10 -4
  44. package/CHANGELOG.md +0 -7227
  45. package/History.md +0 -1
  46. 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 false to skip applying global plugins to child schemas.
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
  */