I have a schema with a field type: Object . But whenever i do an insert, that object is empty.  
Here is my schema
Contacts.attachSchema(new SimpleSchema({
    firstName: {
        type: String,
    },
    lastName: {
        type: String,
        optional: true
    },
    twitterFriend: { // this field
        type: Object,
        optional: true
    }
}));
Even if do Contacts.insert({firstName: 'Mustafa', twitterFriend: {test: 'this should be stored'}}) . It does not work. 
For an object of arbitrary sub-schema you set blackbox: true
Contacts.attachSchema(new SimpleSchema({
    firstName: {
        type: String,
    },
    lastName: {
        type: String,
        optional: true
    },
    twitterFriend: { // this field
        type: Object,
        optional: true,
        blackbox: true
    }
}));
See SimpleSchema docs for reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With