Closed manzato closed 7 years ago
Looks like insert.js
, upsert.js
, and remove.js
could benefit from these same checks. Quickly scanning through, looks like these are other potential areas to check for not isEmpty:
https://github.com/matb33/meteor-collection-hooks/blob/master/insert.js#L45 https://github.com/matb33/meteor-collection-hooks/blob/master/upsert.js#L25 https://github.com/matb33/meteor-collection-hooks/blob/master/upsert.js#L31 https://github.com/matb33/meteor-collection-hooks/blob/master/upsert.js#L45 https://github.com/matb33/meteor-collection-hooks/blob/master/upsert.js#L56 https://github.com/matb33/meteor-collection-hooks/blob/master/upsert.js#L74 https://github.com/matb33/meteor-collection-hooks/blob/master/remove.js#L18 https://github.com/matb33/meteor-collection-hooks/blob/master/remove.js#L23
I've cherry-picked this commit and added some more checks where I could find code doing unnecessary document fetching.
Thank you for the PR. ❤️
Fixes #203