Type alias InferSchemaType<TSchema>

InferSchemaType<TSchema>: IfAny<TSchema, any, ObtainSchemaGeneric<TSchema, "DocType">>

Type Parameters

  • TSchema

    typeof a schema instance.

Summary

Obtains document schema type from Schema instance.

Example

const userSchema = new Schema({userName:String});
type UserType = InferSchemaType<typeof userSchema>;
// result
type UserType = {userName?: string}

Generated using TypeDoc