mongoose 8.18.0 → 8.18.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mongoose",
3
3
  "description": "Mongoose MongoDB ODM",
4
- "version": "8.18.0",
4
+ "version": "8.18.1",
5
5
  "author": "Guillermo Rauch <guillermo@learnboost.com>",
6
6
  "keywords": [
7
7
  "mongodb",
@@ -29,8 +29,8 @@
29
29
  "sift": "17.1.3"
30
30
  },
31
31
  "devDependencies": {
32
- "@babel/core": "7.28.0",
33
- "@babel/preset-env": "7.28.0",
32
+ "@babel/core": "7.28.3",
33
+ "@babel/preset-env": "7.28.3",
34
34
  "@mongodb-js/mongodb-downloader": "^0.4.2",
35
35
  "@typescript-eslint/eslint-plugin": "^8.19.1",
36
36
  "@typescript-eslint/parser": "^8.19.1",
@@ -56,9 +56,9 @@
56
56
  "markdownlint-cli2": "^0.18.1",
57
57
  "marked": "15.0.12",
58
58
  "mkdirp": "^3.0.1",
59
- "mocha": "11.7.1",
59
+ "mocha": "11.7.2",
60
60
  "moment": "2.30.1",
61
- "mongodb-memory-server": "10.1.4",
61
+ "mongodb-memory-server": "10.2.0",
62
62
  "mongodb-runner": "^5.8.2",
63
63
  "ncp": "^2.0.0",
64
64
  "nyc": "15.1.0",
@@ -66,10 +66,10 @@
66
66
  "q": "1.5.1",
67
67
  "sinon": "21.0.0",
68
68
  "stream-browserify": "3.0.0",
69
- "tsd": "0.32.0",
70
- "typescript": "5.8.3",
69
+ "tsd": "0.33.0",
70
+ "typescript": "5.9.2",
71
71
  "uuid": "11.1.0",
72
- "webpack": "5.101.0"
72
+ "webpack": "5.101.3"
73
73
  },
74
74
  "directories": {
75
75
  "lib": "./lib/mongoose"
@@ -111,8 +111,8 @@ declare module 'mongoose' {
111
111
  PathValueType extends 'bigint' | 'BigInt' | typeof Schema.Types.BigInt | typeof BigInt ? bigint :
112
112
  PathValueType extends 'uuid' | 'UUID' | typeof Schema.Types.UUID ? Buffer :
113
113
  IfEquals<PathValueType, Schema.Types.UUID> extends true ? Buffer :
114
- PathValueType extends MapConstructor | 'Map' ? Map<string, ResolveRawPathType<Options['of']>> :
115
- IfEquals<PathValueType, typeof Schema.Types.Map> extends true ? Map<string, ResolveRawPathType<Options['of']>> :
114
+ PathValueType extends MapConstructor | 'Map' ? Map<string, ObtainRawDocumentPathType<Options['of']>> :
115
+ IfEquals<PathValueType, typeof Schema.Types.Map> extends true ? Map<string, ObtainRawDocumentPathType<Options['of']>> :
116
116
  PathValueType extends 'Union' | 'union' | typeof Schema.Types.Union ? Options['of'] extends readonly any[] ? UnionToRawPathType<Options['of']> : never :
117
117
  PathValueType extends ArrayConstructor ? any[] :
118
118
  PathValueType extends typeof Schema.Types.Mixed ? any:
@@ -272,7 +272,7 @@ type ResolvePathType<PathValueType, Options extends SchemaTypeOptions<PathValueT
272
272
  // we need to call ObtainDocumentType to correctly infer its type.
273
273
  Types.DocumentArray<ObtainDocumentType<Item, any, { typeKey: TypeKey }>> :
274
274
  IsSchemaTypeFromBuiltinClass<Item> extends true ?
275
- ObtainDocumentPathType<Item, TypeKey>[] :
275
+ ResolvePathType<Item, { enum: Options['enum'] }, TypeKey>[] :
276
276
  IsItRecordAndNotAny<Item> extends true ?
277
277
  Item extends Record<string, never> ?
278
278
  ObtainDocumentPathType<Item, TypeKey>[] :
@@ -316,8 +316,8 @@ type ResolvePathType<PathValueType, Options extends SchemaTypeOptions<PathValueT
316
316
  PathValueType extends 'uuid' | 'UUID' | typeof Schema.Types.UUID ? Buffer :
317
317
  PathValueType extends 'double' | 'Double' | typeof Schema.Types.Double ? Types.Double :
318
318
  IfEquals<PathValueType, Schema.Types.UUID> extends true ? Buffer :
319
- PathValueType extends MapConstructor | 'Map' ? Map<string, ResolvePathType<Options['of']>> :
320
- IfEquals<PathValueType, typeof Schema.Types.Map> extends true ? Map<string, ResolvePathType<Options['of']>> :
319
+ PathValueType extends MapConstructor | 'Map' ? Map<string, ObtainDocumentPathType<Options['of']>> :
320
+ IfEquals<PathValueType, typeof Schema.Types.Map> extends true ? Map<string, ObtainDocumentPathType<Options['of']>> :
321
321
  PathValueType extends 'Union' | 'union' | typeof Schema.Types.Union ? Options['of'] extends readonly any[] ? UnionToType<Options['of']> : never :
322
322
  PathValueType extends ArrayConstructor ? any[] :
323
323
  PathValueType extends typeof Schema.Types.Mixed ? any:
package/types/models.d.ts CHANGED
@@ -435,7 +435,7 @@ declare module 'mongoose' {
435
435
  TQueryHelpers & ObtainSchemaGeneric<TDiscriminatorSchema, 'TQueryHelpers'>,
436
436
  TInstanceMethods & ObtainSchemaGeneric<TDiscriminatorSchema, 'TInstanceMethods'>,
437
437
  TVirtuals & ObtainSchemaGeneric<TDiscriminatorSchema, 'TVirtuals'>
438
- > & ObtainSchemaGeneric<TDiscriminatorSchema, 'TStaticMethods'>;
438
+ > & ObtainSchemaGeneric<TSchema, 'TStaticMethods'> & ObtainSchemaGeneric<TDiscriminatorSchema, 'TStaticMethods'>;
439
439
  discriminator<D>(
440
440
  name: string | number,
441
441
  schema: Schema,
@@ -180,7 +180,7 @@ declare module 'mongoose' {
180
180
  *
181
181
  * @default '__v'
182
182
  */
183
- versionKey?: string | boolean;
183
+ versionKey?: string | false;
184
184
  /**
185
185
  * By default, Mongoose will automatically select() any populated paths for you, unless you explicitly exclude them.
186
186
  *