So I just want to notify user with connection.id = ywB9jPmCwguxjasDk if User collection changes. Is it possible to do that? Currently all users are notified if collection changes. Thank you
Take a look at EventDDP. It’s a pretty old package, but it works just fine even with latest Meteor. It lets you to send event messages to clients and filter them by user ID.
All users will get the results of the first call to subscribe('test1…)`
Everyone else gets nothing
// Declare UserAccessConnection as global variable
// (or could be local variable if in the same file)
UserAccessConnection = null;
Meteor.onConnection(function(connection) {
console.log(connection.id + ", " + connection.clientAddress);
// some logic...
UserAccessConnection = connection.id;
});