Reputation: 990
I'm using AutoForm for forms and SimpleSchema with Collection2 to schema.
In my schema there are some fields which are generated during document insert/creation and are able to change later on.
When it's the best place to generate data and put into database?
autoValue
directly in schema.matb33:collection-hooks
before/after.insert hooks.What's are pluses and minuses in each case?
Upvotes: 0
Views: 62
Reputation: 122
I Would say the following:
typically I use autoValue for automatically setting the loggedInUser, createdAtDate, updatedAtDate.. etc and I use matb3:collection-hooks for example when I create a user and and I automatically want to create a event log in the database.
Hope it helps you.
Upvotes: 0