meteor-collection-hooks icon indicating copy to clipboard operation
meteor-collection-hooks copied to clipboard

fetchPrevious option cannot prevent fetching of the previous documents

Open baryshok opened this issue 6 years ago • 1 comments

According to the documentation of an .after.update hook:

The optional fetchPrevious option, when set to false,
will not fetch documents before running the hooks.

But really the documents are fetched anyway regardless of this option set to false. It happens here: https://github.com/Meteor-Community-Packages/meteor-collection-hooks/blob/1c4de620b00825f933410f1ce1eb059f73e10f74/update.js#L24 The documents are fetched to get their ids that are later used in the .after.update hook. I don't see an easy way to make the option work as it should. So I believe it needs a proper description in the documentation. Because currently both the name of the option and its description are misleading. Thanks!

baryshok avatar Nov 28 '19 09:11 baryshok

Hit this unexpected and potentially expensive pre-fetch as well via cult-of-coders:grapher links; related issue: https://github.com/Meteor-Community-Packages/denormalize/issues/33

mfen avatar Jan 09 '23 20:01 mfen