Optimized subscriptions

This commit is contained in:
Senad Uka
2016-03-06 09:20:36 +01:00
parent 6ea9933d60
commit 357acd6f91
6 changed files with 30 additions and 13 deletions

View File

@@ -0,0 +1,18 @@
// This code only runs on the server
Meteor.publish("sensor_data", function(controllerId) {
return SensorData.find({
controllerId: controllerId
}, {
sort: {
created_at: -1
},
limit: 100
});
});
// This code only runs on the server
Meteor.publish("controller_state", function(controllerId) {
return ControllerState.find({
controller_id: controllerId
});
});