I wish to find all users, not the current User. A pair of users are stored within a "Room" array under this collection structure:
structure of each room (from another html page)
var newRoom = Rooms.insert({
owner : Meteor.userId(),
receiver : receiver,
people : [ owner , receiver ],
});
Collection.js (using dburles collection helper)
Rooms.helpers({
receiverName: function() {
return Meteor.users.findOne({ _id: this.receiver }).username;
}
});
html
<!-- **allRooms.html** Works fine, names appear -->
{{#each rooms}} {{receiverName}}{{/each }}
<!-- **roomDetail.html** names dont show, this.receiver undefined -->
{{receiverName}}
roomDetail js template helper
self.subscribe('room', Router.current().params._id);
self.subscribe('users');
});
How do I return and display the user's Id thats not the current user from the people field which is an array? I hope to show it in the child page (roomDetail).