-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Closed
Labels
Description
I have an VO[] that gets persisted to postgres.
@Column(ColumnTypes.JSON, {nullable: true})
weights: VO[];
The field value in the database is:
[{"documentId":140,"topicId":24,"weight":0.25},{"documentId":140,"topicId":24,"weight":0.25},{"documentId":140,"topicId":26,"weight":0.25},{"documentId":140,"topicId":27,"weight":0.25}]
When i try and read that out of the database, it calls:
PostgresDriver.ts => prepareHydratedValue
and calls JSON.parse(value)
This results in:
Unexpected token o in JSON at position 1
Why is the field value in the database not stringified?