1

I have documents from a server-side collection published. However, I don't need reactivity on the client side.

For performance reasons, I'd like to just query the db manually from the client like in a traditional web app.

One option is subscribing and then stoping the subscription.

// something like this:
var People = new Meteor.Collection('people');
var handle = Meteor.subscribe('people'); // assume people is published on server
var results = People.find().fetch()
handle.stop();

However, calling handle.stop clears the cache on the client side. I want to keep the cache and manually re-download the content as needed. Is this possible?

Edit: I just found the {reactive: false} option for Collection.find(). This prevents changes from invalidating the computation. I believe it does not prevent changes in the DB from being synced with the minimongo collection. Is this correct?

Charles Holbrow
  • 3,967
  • 6
  • 30
  • 35

1 Answers1

0

One way to do this is:

  • initialize an unmanaged Collection on the client
  • use Meteor.methods to populate it as needed

However, This limits the selectors you can use for querying securely, and requires you manually insert all the data retrieved via methods. This approach also limits the reactive functionality of the unmanaged Collection.

Charles Holbrow
  • 3,967
  • 6
  • 30
  • 35