diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 7e45ea835a..b819e37ad9 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -516,7 +516,7 @@ declare module "mongoose" { /** defaults to 1 */ parallel?: number; } - + /* * section querycursor.js * http://mongoosejs.com/docs/api.html#querycursor-js @@ -807,7 +807,7 @@ declare module "mongoose" { * Intellisense for Schema definitions */ interface SchemaDefinition { - [path: string]: SchemaTypeOpts; + [path: string]: SchemaTypeOpts | Schema | SchemaType; } /* @@ -2723,7 +2723,7 @@ declare module "mongoose" { passRawResult?: boolean; /** overwrites the schema's strict mode option for this update */ strict?: boolean; - /** + /** * if true, run all setters defined on the associated model's schema for all fields * defined in the query and the update. */ diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index 7216ed73fb..d6f262ebf6 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -368,8 +368,8 @@ new mongoose.Schema({d: {type: Date, min: [ new mongoose.Schema({ integerOnly: { type: Number, - get: v => Math.round(v), - set: v => Math.round(v) + get: (v: number) => Math.round(v), + set: (v: number) => Math.round(v) } }); new mongoose.Schema({ name: { type: String, validate: [