class - 如何使用 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//
}
解决方案
推荐阅读
- php - Detect when a user changes any of their billing details (user meta)
- botframework - Speech functionality not working in IFrame
- laravel - 如何使用 Laravel 在引导模式中获取动态数据?
- macos - Safari 应用程序扩展:contentBlocker(withIdentifier:blockedResourcesWith:on:),它是如何工作的?如何让它工作?
- java - Java - 我尝试打印时出现线程池同步问题
- html - 桌面两列布局,移动一列,儿童不同顺序
- mongodb - BulkWriteError - MongoDB
- java - 使用流在 java 8 中拆分 entrySet 和过滤器
- c# - 如果我将虚拟关键字添加到属性,我需要帮助解决为什么实体框架不会保存
- mysql - 基于相似字段,使用同一表中另一行的数据更新一行