Optimized subscriptions
This commit is contained in:
18
app/server/publications.js
Normal file
18
app/server/publications.js
Normal 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
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user