I have been trying for days to get a list of logged in users in a Meteor chat app. I tried many different things. I managed to add a login flag on the user profile object. Serve
To change the users profile.login
property you need to do Meteor.users.update(..)
or call a server method that does that. Just changing the user object's property will not work.
Generally I would recommend to not persist the users state into the mondodb database but hold it in a Collection in memory.
The easiest might be to just use one of these packages:
or study their source code to see how to propagate the user status.