I am using Meteor 0.8.0.
For a simple chat applicaton I have a messages collection with
- user_id
- message text
- timestamp
The user_id refers to a user from Meteor.users.
On the client, I want to dispay a list of the messages including the user name. Straithforward solutions involve publishing the messages and users collections and doing the 'join' on the client. However, I don't want to expose any user_ids to the client in any way.
Solutions I can think of:
- Modify the messages publication by removing user_id (easy with 'fields') and adding the user name (hard, I found this, but produced errors with Meteor 0.8.0, since it relies on internals which have propably changed.
- Use Meteor.methods/.call from a template helper, but that is difficult because of the asynchronous nature of Meteor.call. The solutions suggested here or here either don't work in loops or are quite complicated.
Is there a clean and simple solution for this in Meteor?
After having experimented with Meteor for a while, my general feeling is, that you quickly expose to much internal information and when you try to restrict it, it quickly becomes very tedious.