Bug description
When you do a prisma.table.create or prisma.table.update with an array value, the array is converted to a serialized string.
How to reproduce
Based on a minimal schema on PostgreSQL:
model stories {
id Int @id @default(autoincrement())
title String
tags Json
}
import { PrismaClient } from "@prisma/client"
const prisma = new PrismaClient()
async function start() {
const data = { title: "Cool", tags: ["Matrix", "Star Wars"] }
const createStory = await prisma.stories.create({ data })
console.log(createStory)
console.log(typeof createStory.tags) // returns `string`
const story = (await prisma.stories.findMany({ take: 1 }))[0]
console.log(story)
console.log(typeof story.tags) // returns `string`
}
start()
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 a string.

string, number and object work okay.
Expected behavior
When you insert an array it should be returned as an array
Prisma information
Shared above
Environment & setup
- OS: Mac OS
- Database: PostgreSQL
- Prisma version: Prisma 2, beta 7
- Node.js version: 12.16.2
Bug description
When you do a
prisma.table.createorprisma.table.updatewith 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,numberandobjectwork okay.Expected behavior
When you insert an
arrayit should be returned as anarrayPrisma information
Shared above
Environment & setup