I have a database with registration records. Problem is when client subscribe all the records are return from server!. I only need to return records that were (inserted, updated, changed) AFTER user subscribes! I know that the most logical solution is to make a query where record (in my case reservation stat_time is greater than current time (or in more specific time when client subscribes) but this does not work for me because I also need to track for older records( start_time is < current_time) for example update, delete) Here’s my code
Meteor.publish('stationTime', function (stationId) {
return Collections.Reservation.find({station_id: stationId});
});
Can you explain a little more? You say you want to track changes after the user subscribes, but then say that you also want to track changes before the user subscribes. So you seem to be saying you want to track all changes.
You can also use the low-level observe api and hook into the added/changed/removed callbacks to do just about anything. Here’s an example (though you’d want to implement better selector and options checking):