Files
old-tfm/app/server/publications.js
2017-05-21 17:51:45 +02:00

30 lines
628 B
JavaScript

// This code only runs on the server
Meteor.publish("sensor_data", function(controllerId) {
return SensorData.find({
controllerId: controllerId
}, {
sort: {
created_at: -1
}
});
});
// This code only runs on the server
Meteor.publish("controller_state", function(controllerId) {
return ControllerState.find({
controller_id: controllerId
});
});
Meteor.publish("all_controller_states", function() {
return ControllerState.find({});
});
// This code only runs on the server
Meteor.publish("pictures", function(controllerId) {
return Picture.find({
controller_id: controllerId
});
});