I'm trying to add a new row to a table in postgres using TypeORM, but receive the issue related to array literals. The problem occurs with a subscriptions field
Entity format:
export class User {
@PrimaryColumn()
userId: string;
@Column("varchar")
email: string;
@Column("text", { array: true })
userCookieIds: string[];
@Column("varchar", { array: true })
userLocalIds: string[]
@Column("jsonb", { array: true })
subscriptions: object[]
}
The code of typeORM insert:
user = new User()
user.userId = uuidv4()
user.email = ''
user.userCookieIds = [userCookieId]
user.subscriptions = []
user.userLocalIds = []
await this.usersRepository.save(user)
I checked all similar questions on StackOverflow, but it didn't help :-(
Any help is highly appreciated