Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Listing all users on client with meteor

According the the meteor documentation, all users should be published to all clients if the autopublish package is installed.

http://docs.meteor.com/#meteor_users

I have the autopublish package installed, but using forEach on Meteor.users only lists the currently logged in user.

Is there a more correct way to list all the users on the client by using coffeescript?

like image 302
danielsvane Avatar asked Nov 24 '12 02:11

danielsvane


1 Answers

Here is an excerpt from Meteor's Parties example:

// in server.js
Meteor.publish("directory", function () {
  return Meteor.users.find({}, {fields: {emails: 1, profile: 1}});
});

// in client.js
Meteor.subscribe("directory");
like image 163
Amir Nissim Avatar answered Sep 19 '22 14:09

Amir Nissim