How to add fields to the Meteor.users collection

meteor

Solution

you should use "fields" keyword

Meteor.users.find({ _id: this.userId },
    { fields: { the-extra-fields-that-you-want-go-here: 1 } }
);

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

Problem

I want the Facebook accessToken that is stored in my user's document on the client. Following the meteor documentation, I should just add a new publish call. In server.js: ``` Meteor.publish("access_token", function () { return Meteor.users().find( { _id : Meteor.userId() }, {'services.facebook.accessToken': 1} ); }); ``` In client.js: ``` Meteor.subscribe("access_token"); ``` Alright, here's where I get lost. Should the accessToken just show up in the Meteor.users collection now for the logged in user? Like: ``` var user = Meteor.users.findOne({ _id : Meteor.userId() }); console.log(user); // includes services.facebook.accessToken now ``` Obviously, I've tried the above and the accessToken doesn't show up. Yes, I've confirmed that the mongo document contains services.facebook. So... do I create a new client collection and somehow hook it up to the new publish? How do I get the accessToken?

Original source