猫鼬验证失败:必填路径

时间:2018-10-29 04:22:54

标签: json reactjs mongodb mongoose redux

猫鼬这么说很奇怪,因为我很确定我有东西。

这是我的猫鼬模型:

var Job = mongoose.model('Job', new Schema({
_creator: {
    type: mongoose.Schema.Types.ObjectId,
    required: true
},
companyName: {
    type: String,
    required: true,
    trim: true
},
position: {
    type: String,
    required: true,
    trim: true
},
isCurrent: {
    type: Boolean
    // required: true
},
startedDate: {
    type: Date,
    required: true
},
endDate: {
    type: Date
},
descriptions: [{
    description: {
        type: String,
        required: true
    },
    skills: [{
        skillId: {
            type: mongoose.Schema.Types.ObjectId,
            required: true
        },
        skillName: {
            type: String,
            required: true
        }

    }]

}]
}));

这是我要发送到服务器的虚拟数据,在发布前立即打印出来: enter image description here

但是它告诉我它需要路径description,该路径已经包含在上面的作业对象中:

enter image description here

超级困惑。任何帮助表示赞赏!

0 个答案:

没有答案