Meteor-Community-Packages / meteor-collection-hooks

Meteor Collection Hooks
https://atmospherejs.com/matb33/collection-hooks
MIT License
658 stars 90 forks source link

fetchPrevious option cannot prevent fetching of the previous documents #259

Open baryshok opened 4 years ago

baryshok commented 4 years ago

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!

mfen commented 1 year ago

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