Obtenez tous les champs du schéma de la mongoose dactylographié

export const getFieldsFromSchemas = <T extends { paths: { [key: string]: SchemaType<any> } }>(schema: T): string[] => {
	return Object.keys(schema.paths);
};
Husnain Syed