Meteor-Community-Packages / meteor-collection-hooks

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

Do collection hooks work when inserting into the database directly? #112

Closed francisbyrne closed 9 years ago

francisbyrne commented 9 years ago

I've written a hook like so:

Recordings.after.insert(function(userId, rec) {
  console.log('Inserted recording..................');
});

Then I tried inserting directly into the database via meteor mongo and my hook was never called.

Is that expected behaviour?

rclai commented 9 years ago

It won't work if you do mongo operations directly in the mongo shell.

francisbyrne commented 9 years ago

Gotcha, thanks.

rclai commented 9 years ago

You might be able to use Meteor's observe APIs to do something, at least after an operation.