I have this application I'm working on ...
http://stevedavis.meteor.com/
You can see the contents of group collections by running "console.find ()" in the console.
I have this in my JS ...
Template.listGroups.events({ 'click .deleteMember': function(){ var groupID = this.groupID, firstName = this.firstName, lastName = this.lastName; } });
So, I want to be able to remove a member from the group if I click on X next to their name. I tried...
Groups.update( {"_id": groupID }, {$unset: { "members" : {"firstName": firstName, "lastName": lastName} } } );
but he deleted ALL items. I just want it to delete the member element that matches the first and last click name of the element. Thanks.
source share