Publish the current user's document from Meteor.users

Currently I am trying to publish the current user’s document from the Meteor.users collection.
Here is my code:
> Meteor.publish(‘users_current’, function() {
> console.log(this.userId);
> return Meteor.users.find({_id: this.userId}, {
> fields: {
> ‘self_email’: 1,
> ‘self_name’: 1,
> ‘self_school’: 1
> }
> });
> });
It seems to return ALL users in the Meteor.users collection after a few seconds, even though my console.log is giving me just the current user’s ID. Also it always gives me the built in “emails” field.
Thanks all!

It’s a default Meteor.user subscription that gives you the built in “emails” field, together with “username”, “_id” and “profile”.

Thank you that’s what I figured about that question.
Any thoughts on the publication returning all users in the collection?

Have you removed the autopublish package?

1 Like