Meteor-Community-Packages / meteor-collection-hooks

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

collection.direct.update(id, ...) doesn't work #89

Closed rclai closed 9 years ago

rclai commented 9 years ago

Is this intentional? Vanilla Meteor collection.update lets you pass in an ID.

I had to explicitly pass { _id: id } when using collection.direct.update.

matb33 commented 9 years ago

Are you using the latest version of collection-hooks? I just wrote an additional test to verify this behavior and with the latest version, it passed

flean commented 9 years ago

Same issue with me. v 0.7.9

matb33 commented 9 years ago

I wrote tests in 0.7.10 (unpublished) that verify that it works, so I must be missing something. Can any of you provide a sample that reproduces the issue?

rclai commented 9 years ago

Okay, coming right up.

rclai commented 9 years ago

Here it is: https://github.com/rclai/collection-hooks-direct-update-issue This closely represents my use case and it was using 0.7.9.

matb33 commented 9 years ago

Ah I see why my test didn't catch it... I'm setting connection: null when creating the test collection out of simplicity, which I believe then uses the minimongo driver on the server too... I'll take a look ASAP

matb33 commented 9 years ago

Just FYI, I spent a bit of time on this and it's a tough one to fix. I'll get back to it as soon as I can.

rclai commented 9 years ago

Ok np, I'll just { _id: 'specify this' } for now on.