My Sails application helps monitor the state of our system by monitoring a mix of artifacts (log files, exports, etc) and real-time changes (events, web-hooks, etc).
On various schedules the application reads the artifacts and uses .findOrCreate()
and .update()
to update the Sails application state. Sails then sets the instances createdAt
and updatedAt
properties to new Date()
at the time of saving; however I'd like these times to match their source artifact's time-stamp.
How can I override the values for their createdAt
and updatedAt
properties of a Sails.js model? And would there be any obvious gotcha's as a result of setting them to a specific timestamp?