Collection for single user and groups


#1

I have a solution where users can make a list of colors and images to mirror themselves. I add each color and image as a document in Items.Collection with a userId and mirrorId. Items are then published by userId to get the relevant data per user and mirror.

How can I create a group from that and let several users see each others choices? If I add a groupId in Items, can I publish by that using the same Collection?

Is this the right path? How do I do with Meteor.subscribe? Is that Meteor.subscribe(‘groupitems’)?

Meteor.publish('items', function(){
  var options = {fields: {userId: 0}};
  return Items.find({userId:this.userId},options);
});

Meteor.publish('groupitems', function(){
  var options = {fields: {groupId: 0}};
  return Items.find({groupId:this.groupId},options);
});