Hi
I have some events _id’s and when people Approve a event I do this:
Events.update(
{_id: eventId},
{ $addToSet:{ approvedId: Meteor.userId() }}
);
To add the user to the approvelist
But howto on the main.js (server) make a:
var getthecat = Events.find(_id: eventId)
AND
Meteor.users.update(
{_id: Meteor.userId()},
{ $addToSet:{ categories: getthecat.category }}
);
So the user will add the category to the users array of categories