I'm attempting to filter out certain documents from appearing on the client side based on user interaction.
Here is an example of what I've tried but unfortunately it didn't work:
Template.documents.events({
'click #dontShowThisDocument': function () {
Session.set('excludedDocument', this._id);
}
});
Template.documents.helpers({
lists: function () {
var excludedDocuments = [];
excludedDocuments.push(Session.get('excludedDocument'));
return Coll.find({_id:{$nin:excludedDocuments});
}
});
Is there a way to store excluded document IDs in an array using Meteor, so that users can dynamically exclude specific documents from a list?
Thank you for your help!