11
我有一個字段爲type: Object
的模式。但是,每當我做一個插入,該對象是空的。用流星簡單模式在場中存儲任意對象
這裏是我的架構
Contacts.attachSchema(new SimpleSchema({
firstName: {
type: String,
},
lastName: {
type: String,
optional: true
},
twitterFriend: { // this field
type: Object,
optional: true
}
}));
即使做Contacts.insert({firstName: 'Mustafa', twitterFriend: {test: 'this should be stored'}})
。這是行不通的。
感謝隊友,我知道它必須在那裏 – MurWade 2015-04-06 04:31:38
這似乎並沒有工作,這就像SimpleSchema只是忽略黑匣子? – Jan 2016-10-10 17:24:20
@Jan您可能需要在另一個問題中發佈您的代碼,然後將其鏈接到它。也許別的東西稍微偏離? – 2016-10-11 21:13:50