小编TAM*_*M.G的帖子

更新时将时间戳与nestjs一起使用不会更新

我正在将 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 中使用时间戳,因为它不显示任何日期!

timestamp mongodb nestjs

5
推荐指数
1
解决办法
7060
查看次数

标签 统计

mongodb ×1

nestjs ×1

timestamp ×1