Meteor-Community-Packages / meteor-collection-hooks

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

Fix unsafe selector for find and findOne #215

Closed zimme closed 7 years ago

zimme commented 7 years ago

This should fix the problem where the selector isn’t properly defined for the case when find and findOne is called without arguments.

In this case the selector should actually be set to an empty object instead of being undefined.

This got me thinking that we should probably do the same with other operators. I looked at the code for update in meteor and it runs self._rewriteSelector to make sure the selector is safe.

zimme commented 7 years ago

This is related to zimme/meteor-collection-softremovable#26 and meteor/meteor#8220.

zimme commented 7 years ago

Also @matb33, I'm not sure how I should handle the merge and publish as it will most likely be a breaking change for people that might be relying on the old selector value.