I got this error in my NestJS app:
[Nest] 34133 - 02/04/2022, 14:23:30 ERROR [TypeOrmModule] Unable to connect to the database. Retrying (4)...
QueryFailedError: column "<columnName>" contains null values
The following field in API produced this error, probably its related to TypeORM module:
I fixed this error by configuring the @Column
decorator. I have enabled the nullable
flag for it:
@ApiProperty({ description: 'The id of the connected Model' })
@IsDefined()
@Column({type: 'json', nullable: true})
someField: any;