I am trying to save an array of object in jsonb type in postgres
Entity
@Column({type: 'jsonb', array: true, nullable: true})
testJson: object[];
The json I am sending in postman
{
"testJson": [
{"skill": "docker", "experience": true},
{"skill": "kubernetes", "experience": false}
]
}
I am getting error 'malformed array literal:'
Also kindly tell if I can query such data types?
I had the same problem. This worked for me
@Column('jsonb', {nullable: true})
testJson?: object[];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With