jagi / meteor-astronomy-timestamp-behavior

https://atmospherejs.com/jagi/astronomy-timestamp-behavior
MIT License
5 stars 6 forks source link

Added the ability to ignore certain fields #9

Open ffxsam opened 7 years ago

ffxsam commented 7 years ago

Use case:

I have a collection of items that have a field called views that's updated every time someone clicks on the item. I realized that when this was being modified, the updatedAt was being updated as well. I've added an option called ignoreFields which takes an array of field names. Updates to these fields will not result in updating updatedAt.

ffxsam commented 7 years ago

BTW I realize one can just use the regular Meteor way of updating a collection to avoid the timestamp beforeUpdate event from triggering. :) I wanted to add this as just an extra nice option to have handy.