Meteor-Community-Packages / meteor-collection-hooks

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

After filtering out keys not in the schema, your modifier is now empty. after.insert problems. #177

Open patrickbolle opened 8 years ago

patrickbolle commented 8 years ago

Hey, great package thanks a lot.

I've been having trouble with the after.insert method. Listings.after.insert(function(userId, doc) { Meteor.users.update( {_id: userId}, { $push: { "profile.listings.$": doc._id } } ) });

Like this, I get the following error in my JS console - Uncaught Error: After filtering out keys not in the schema, your modifier is now empty

If I get rid of userId, it instead changes to (of course) - Uncaught ReferenceError: userId is not defined

I believe this is a collection-hooks problem, but it very well might not be. Let me know, thanks!

EDIT - I removed the Meteor.users.update section, just leaving the hook and a console log line. The hook triggers, the console line appears, but my autoform doesn't insert anything now..

Weird..

hafizali05 commented 8 years ago

same issue here

kumarravigithub commented 8 years ago

Same issue here. Anybody?

namirsab commented 7 years ago

It seems you are using collection2 aren't you?