Meteor 对象数组通过验证,但不';t更新集合
我的更新方法正在通过简单模式验证测试,但是它没有更新我的集合。我正在更新一组对象 示例:Meteor 对象数组通过验证,但不';t更新集合,meteor,simple-schema,meteor-collection2,Meteor,Simple Schema,Meteor Collection2,我的更新方法正在通过简单模式验证测试,但是它没有更新我的集合。我正在更新一组对象 示例:array var arrayTest=[ { 公司名称:"sdsd",, 唯一标识:1500431892902, 标题:“”, 说明:“”, startDateMonth:“”, 起始日期:'', endDateMonth:“”, endDateYear:“”, isCurrent:false, isDisabled:错误, } ]; 验证:数组 newsimpleschema({ 公司:{type:
array
var arrayTest=[
{
公司名称:"sdsd",,
唯一标识:1500431892902,
标题:“”,
说明:“”,
startDateMonth:“”,
起始日期:'',
endDateMonth:“”,
endDateYear:“”,
isCurrent:false,
isDisabled:错误,
}
];
验证:数组
newsimpleschema({
公司:{type:String,可选:true},
唯一ID:{type:Number,可选:true},
标题:{type:String,可选:true},
描述:{type:String,可选:true},
startDateMonth:{type:String,可选:true},
startDateYear:{type:String,可选:true},
endDateMonth:{type:String,可选:true},
endDateYear:{type:String,可选:true},
isCurrent:{type:Boolean,可选:true},
isDisabled:{type:Boolean,可选:true}
}).验证(
arrayTest
);
更新:收藏
ProfileCandidate.update({
_id:“BoDb4Zztq7n3evTqG”
}, {
$set:{
careerHistoryPositions:arrayTest
}
},(错误、结果)=>{
如果(错误){
日志(“错误:”,“错误”);
}
如果(结果){
console.log(“结果”,result);
}
});
更新似乎有效,但没有数据进入架构。您确定
ProfileCandidate.\u id
等于BoDb4Zztq7n3evTqG
?您是否有ProfileCandidate
schema验证?对id问题是。如何进行模式验证?meteor简单模式和node简单模式(我不知道您使用的是哪种模式)中都存在一些不同的bug,它们讨论了类似的问题。这可能是个错误:我想你可能是对的。