我有这个模型:
const schema = new Schema({
title: {type: String, required: true},
description: {type: String},
absense: {type: Schema.Types.ObjectId, ref: 'Abscense'},
contract: {type: Schema.Types.ObjectId, ref: 'Contract'},
date: {type: Date},
type: {type: String},
discount_day: {type: Boolean, default: true},
discount_vt: {type: Boolean, default: true},
discount_vr: {type: Boolean, default: true},
crm: {type: String},
doctor_name: {type: String},
child: {type: String}
});
但是在某些情况下,缺少字段是一个空值。可以将其设置为null吗?