首页 > 解决方案 > 如何使用 mongo 模式中不需要的数据创建模型

问题描述

我需要创建一个模型类,它具有注册表单中的所有属性。但是有些属性不是必需的!我如何制作此类并将这些属性设置为不需要?

export class CompanyModel {
  companyName: string;
  companyEmail: string;
  password: string;
  logo: string;
  phoneNumber: string;
  country: string;
  city: string;
  degree: string;
  relatedJobs: // this is not required property//
}

标签: classmodel

解决方案


推荐阅读