"Uncaught Error: After filtering out keys not in the schema, your modifier is now empty"
使用与流星collection2和简单模式自动窗体。 架构:
Injuries = new Mongo.Collection('injuries');
Rehab = new SimpleSchema({
exercise: {
type: String,
label: "Rehab Exercise"
},
sets: {
type: Number,
label: "Sets"
},
duration: {
type: Number,
label: "Set Duration (in Minutes)"
},
date: {
type: String,
label: "Date of Rehab Exercise"
},
rehabnotes: {
type: String,
label: "Notes: i.e. 70% Intensity During Sprints",
max: 200
},
injuryid:{
type: String,
}
});
Injuries.attachSchema(new SimpleSchema({
player: {
type: String,
label: "Player",
max: 50
},
injury: {
type: String,
label: "Injury"
},
notes: {
type: String,
label: "Notes",
max: 200
},
injurydate: {
type: Date,
label: "Date of Injury",
},
rehab: {
type: [Rehab],
optional: true
}
}));
和表单代码的模板:
{{#autoForm collection="Injuries" schema="Rehab" id="insertRehabForm" type="update"}}
<fieldset>
{{> afQuickField name='exercise' options=options}}
{{> afQuickField name='sets'}}
{{> afQuickField name='duration'}}
{{> afQuickField name='date'}}
{{> afQuickField name='rehabnotes' rows=6}}
</fieldset>
<button type="submit" class="btn btn-primary">Insert</button>
{{/autoForm}}
我可以插入文件,只是在主页上了自动精细,使用的单个文档页面我这个自定义窗体在提交时收到错误。
我有一个集合挂钩在提交之前建立起来,但是这看起来只是一个架构错误,或许我在原始Injuries
架构上设置的Rehab
阵列正在搞砸了这个?我为此所做的搜索都是关于模式中的“Type”参数与预期内容不匹配的,但我在这里检查了它们,并且它们看起来不错。建议?