Say I have a collection of articles and I want to then output the name of the user who wrote that article what’s the correct way of doing this?
I tried adding a transform to the collection of ownerName like so:
user = Meteor.users.findOne({_id: this.userId})
if(user) { return user.profile.name; }
else { return ""; }
However this only works if the user with that id is in a subscription. I’m really hoping I don’t need to publish a subscription for all users just for this data (even with just restricted fields to the profile.name I don’t like it).
I also don’t want to de-normalise this and save the name alongside the article.
What am I missing here?