I would like to set the value of createdAt to some time in the past.
However, all of my attempts fail to change the createdAt date in the database. The value remains the same.
const yesterday = ( d => new Date(d.setDate(d.getDate()-1)) )(new Date);
// failed attempts
hang.createAt = yesterday;
hang.set('createdAt', yesterday);
hang.changed('createdAt', yesterday);
await hang.save();
I also tried
const yesterday = ( d => new Date(d.setDate(d.getDate()-1)) )(new Date);
// failed attempt
await hang.update({ createdAt: yesterday });
Proof of issue
2020-10-07T19:24:29.058Z // before
2020-10-07T19:24:29.058Z // after
How can I change the createdAt value of an instance?