"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」參數與預期內容不匹配的,但我在這裏檢查了它們,並且它們看起來不錯。建議?