function sensor_data_collection() { var controllerId = Session.get('controller_id'); return SensorData.find({ controllerId: controllerId }, { sort: { created_at: -1 }, limit: 100 }); } Template.log.helpers({ sensorDataCollection: sensor_data_collection }); Template.log.events({ 'click clear_log': function() { Meteor.call('clearLog'); } }); Template.sensorData.helpers({ created_at_formatted: function() { return moment(this.created_at).format("DD.MM.YYYY, HH:mm") } });