我正在将 NestJs 用于后端项目,并尝试使用时间戳来显示更新和创建日期,但没有显示任何内容!
@Schema()
export class Camera extends Document{
// @Prop({required: true, unique: true})
@Prop({required: true})
facility_name: string;
@Prop({required: true, unique : true})
camera_id: string;
@Prop({required: true})
camera_location: string;
@Prop({required: true})
camera_type: string;
@Prop({default : false})
is_deleted : boolean;
@Prop()
timestamps: true;
}
export const cameraSchema = SchemaFactory.createForClass(Camera); }
Run Code Online (Sandbox Code Playgroud)
我如何在 frmawork 中使用时间戳,因为它不显示任何日期!