Autoform server side pre insert processing


Using AutoForms, hooks are a great way to add client-side default or custom fields before inserting/updating the collection.

For the life of me, I can’t work out how to do this on the server side instead.
AutoForms provide the method and method-update type for simple schemas, however, i’ve been using update-pushArray for adding new messages to a thread but I’d like to be able to add default fields to the new message on the server side.


You have two very easy options:

and if you like the latter, here’s a great video MeteorCasts ep2 - dburles:collection-helpers and a good article

Of course you can always use for more control