meteor-joins
meteor-joins copied to clipboard
Cannot join Meteor.users if not logged in
Hi,
I have a collection called Messages and I'm trying to join it with Meteor.users to get the author name:
export const Messages = new Mongo.Collection('messages');
Messages.join(Meteor.users, '_author', 'author', ['profile']);
if (Meteor.isServer) {
Meteor.publish('messages', function() {
return Messages.find({}, {
sort: { createdAt: -1 }
});
});
}
If I'm logged in I can see correctly the user name for my messages. If I logout I receive the following error:
Exception from Tracker recompute function:
TypeError: Cannot read property 'profile' of undefined
Hi @Torone thanks for reporting issue, I'll check what's the problem and fix if possible