The answer to zorlak is good.
Some other things:
You can do a one-time publication by writing your own custom publisher using the this.set
API based on code in _publishCursor
. You would do something like:
Meteor.publish("oneTimeQuery", function () { MyCollection.find().forEach(function (doc) { sub.added("collectionName", doc._id, doc); }); sub.ready(); });
This makes a query, sends its results down, and then never updates it again.
Nevertheless, we hope that the performance of Meteor will be such that it is not necessary!
I would also like to add an easy way to get statistics (for example, the number of cursors observed) from an application in Meteor (set up as a certified subscription), but I haven’t done it yet.
source share