Meteor.startup(function () { if (Types.find().count() === 0) { [ { name: 'String', icon: '' }, { name: 'Text, multi-line', icon: '' }, { name: 'Category', icon: '' }, { name: 'Number', icon: '' }, { name: 'Date', icon: '' }, { name: 'Hyperlink', icon: '' }, { name: 'Image', icon: '' }, { name: 'Progress', icon: '' }, { name: 'Duration', icon: '' }, { name: 'Map address', icon: '' }, { name: 'Relationship', icon: '' } ].forEach(function (type, i) { Types.insert({ name: type.name, icon: type.icon, order: i }); } ); console.log('Initialized attribute types.'); } if (Attributes.find().count() === 0) { [ { name: 'Name', type: 'String' }, { name: 'Created at', type: 'Date' }, { name: 'Link', type: 'Hyperlink' }, { name: 'Owner', type: 'Relationship' } ].forEach(function (attribute, i) { Attributes.insert({ name: attribute.name, type: attribute.type, order: i }); } ); console.log('Created sample object type.'); } });