PrismaP
Prisma13mo ago
4 replies
matteosantama

Insert `Map` as `Json`

I have the schema
model Foo {
  id      Int   @id @default(autoincrement())
  fields  Json
}

and I'd like to insert records with type { fields: Map<String, String> }[]. However I'm getting an error Type 'Map<string, string>' is not assignable to type 'JsonNull | InputJsonValue'. How can I get around this?
Was this page helpful?