Question

I'm working on a Meteor app and I want to add a feature that would say how many people are on the website at a time, similar to omegle.com where it says "38,000+ online now" or whatever. Is this possible with Meteor? If it is, I have no idea how to execute it, and that's why I'm asking it here. Does anybody know how to do this?

Était-ce utile?

La solution

You can use presence package for that purpose, see https://atmospherejs.com/package/presence . It provides the live data on the user state. For example, the easiest way to get the number of online users is:

Presences.find({online: true}).count();
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top