Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typescript 如何使用psql在TypeForm中存储对象列表_Typescript_Postgresql_Nestjs_Psql_Typeorm - Fatal编程技术网

Typescript 如何使用psql在TypeForm中存储对象列表

Typescript 如何使用psql在TypeForm中存储对象列表,typescript,postgresql,nestjs,psql,typeorm,Typescript,Postgresql,Nestjs,Psql,Typeorm,我想用TypeForm存储对象列表。。 我的界面是这样的 interface Comments { blogId:number, writtenBy:string, submittedAt:Date } 我想把它存储在TypeForm的数组中 @Column({type:'<Comments>',array: true,default:"{}"}) comments:Comments[] @列({type:'',数组:true,默认值:{})

我想用TypeForm存储对象列表。。 我的界面是这样的

interface Comments {
  blogId:number,
  writtenBy:string,
  submittedAt:Date
}
我想把它存储在TypeForm的数组中

@Column({type:'<Comments>',array: true,default:"{}"})
  comments:Comments[]
@列({type:'',数组:true,默认值:{})
评论:评论[]

我如何才能做到这一点?

我通过将注释列设置为字符串/文本并使用JSON.parse和JSON.stringify来检索答案来解决这个问题

@Column({type: 'jsonb', array: true, nullable: true})
testArray2: object[];