Setting a mongo collection as a session


#1

I want to be able to allow a user to click buttons to change the collection displayed. I can display a collection if I directly put it in , but I cannot use a session to tell the helper function which collection to display. How do I use a session to store a collection variable.

LitText = new Mongo.Collection('Literature');
Session.set('m',LitText);
Template.Chats.helpers({
tasks: function(){
C = Session.get('m');
return C.find({}, {sort: {createdAt: -1}});
}
});

#2

Should I make a function like tasks for each Collection I want to use and use {{#If}} statements to hide and display different collections?