JSON type is broken for array. Array comes back as string
.
#2619
Labels
bug/2-confirmed
Bug has been reproduced and confirmed.
kind/bug
A reported bug.
tech/typescript
Issue for tech TypeScript.
topic: Json
Scalar type `Json`
Milestone
Bug description
When you do a
prisma.table.create
orprisma.table.update
with an array value, the array is converted to a serializedstring
.How to reproduce
Based on a minimal schema on PostgreSQL:
Array data in a JSON field is always serialized (i.e. turned into a
string
). For clarity, I have checked the database and in the database, the value is also astring
.string
,number
andobject
work okay.Expected behavior
When you insert an
array
it should be returned as anarray
Prisma information
Shared above
Environment & setup
The text was updated successfully, but these errors were encountered: