I’m trying to use to a non-persistent collection on server-side:
Searches = new Mongo.Collection('searches', {connection:null});
then publish it:
Meteor.publish('searches', function(){
return Searches.find({})
})
and subscribe to it on the client-side:
Template.Results.onCreated(function() {
var self = this;
self.autorun(function() {
self.subscribe('searches');
});
});
I’m doing so in order to update this collection async on server-side and see the results reactively on the client-side:
server-side (Meteor method that is called by client but running on the server - and I do see the insert works and Searches count increases):
Searches.insert({'x':'insert'})
client-side:
Template.Results.helpers({
searchResults:function(){
return Searches.find({})
},
})
This doesn’t work and I get nothing on the Searches collection on the client side. What am I doing wrong?