使用meteor简单模式在字段中存储任意对象

使用meteor简单模式在字段中存储任意对象,meteor,meteor-collection2,Meteor,Meteor Collection2,我有一个带有字段type:Object的模式。但每当我插入时,该对象都是空的 这是我的模式 Contacts.attachSchema(new SimpleSchema({ firstName: { type: String, }, lastName: { type: String, optional: true }, twitterFriend: { // this field type:

我有一个带有字段
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'stored}})
。它不起作用

对于任意子模式的对象,您设置了
blackbox:true

Contacts.attachSchema(new SimpleSchema({
    firstName: {
        type: String,

    },
    lastName: {
        type: String,
        optional: true
    },
    twitterFriend: { // this field
        type: Object,
        optional: true,
        blackbox: true
    }
}));

请参阅SimpleSchema以供参考。

这似乎根本不起作用,就像SimpleSchema忽略了blackbox?@Jan您可能需要在另一个问题中发布代码,然后将我们链接到它。也许有点不对劲?