@niceseb - were you able to figure this out? I am trying to do the same except filtering out documents where the user IDs are within a group (from alanning:roles package)
“user_id” is the ID of the user who created the design. I want to publish just the designs based on a group but all I have in the DesignsCollection is the user id who created the design.
UPDATE:
I was able to get mine to work using $in. I don’t expect a large number of user “groups” so I think this will work for now.
I turned the cursor that was returned from the Roles.getUsersInRole('customer', _group); into an array and then used that in my query.
var arr_ids = [];
group_ids.forEach(function(obj){arr_ids.push(obj._id)});