meteor-collection-hooks icon indicating copy to clipboard operation
meteor-collection-hooks copied to clipboard

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

Open patrickbolle opened this issue 8 years ago • 3 comments

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..

patrickbolle avatar Feb 25 '16 02:02 patrickbolle

same issue here

hafizali05 avatar Jun 07 '16 17:06 hafizali05

Same issue here. Anybody?

kumarravigithub avatar Jun 20 '16 12:06 kumarravigithub

It seems you are using collection2 aren't you?

namirsab avatar Dec 25 '16 11:12 namirsab