[Solved] How to bypass minimongo

I am trying to save some memory in a large application and there are many collections that don’t really need reactivity, nor to be saved in minimongo as they don’t change during the liftime of the application or change little and reloading the application is acceptable. The only thing they need is to inform the client they have finished sending all the data (similar to “subscriptionReady”).

Those are things like

  • menus (content)
  • help pages
  • date / version of the software
  • change log
  • translations

It’s perfectly acceptable to inform the customer reactively that there is a new version of the application and ask him to reload the application. Therefore all that data could be rendered once it arrives without even need to store it in minimongo.

Collection.find has a reactive flag

reactive Boolean
(Client only) Default true; pass false to disable reactivity

but as far as I can tell it’s only disabiling the reactivity between mini-mongo and the client. It doesn’t prevent the data to go into mini-mongo.

What is the recommended way to proceed for that type of data ?

What you can do is create a method on the server that fetches the info and returns it as a simple array or object. That’s the most lightweight, and it will transfer much faster than subscribing to the same number of documents too. I use this method for translations.


I hadn’t fought about using methods.

In that case I need the UI to know when the Promise has been resolved. Probably some kind of ReactiveVar which will play the role of “subscriptionReady” and trigger the (re)rendering of the data (I am now using React in case anyone wonders)

When using methods you can just call your method in the componentDidMount() lifecycle method. You could set a state with loaded: false and set it to true in the method call callback, if loaded is false then you could display a loader component.

1 Like