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