szokodiakos / typegoose

Typegoose - Define Mongoose models using TypeScript classes.
MIT License
1.22k stars 135 forks source link

[Question] #404

Open kuangshp opened 4 years ago

kuangshp commented 4 years ago

I want the updatedAt field to be updated to the current time by default every time the data is updated,But I couldn't figure out how to solve the problem

@IsDate()
  @prop({
    required: true,
    default: () => Date.now,
  })
  updatedAt!: Date;
hasezoey commented 4 years ago

This repository is not maintained anymore, please look at the new typegoose repo