diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 5eea1625b5..c24427498f 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -769,8 +769,8 @@ declare module "mongoose" { * @param key option name * @param value if not passed, the current option value is returned */ - set(key: string): any; - set(key: string, value: any): this; + set(key: T): SchemaOptions[T]; + set(key: T, value: SchemaOptions[T]): this; /** * Adds static "class" methods to Models compiled from this schema.