PrismaP
Prisma2y ago
1 reply
Clément

Problem with $queryRaw (using Prisma.join) that doesn't return any result

Hi I would like to select items via WHERE IN condition, and I followed the documentation but no results are returned despite the fact that the ids exist in the table.

import { Prisma } from '@prisma/client'

const ids = [1, 3, 5, 10, 20]
const result =
  await prisma.$queryRaw`SELECT * FROM User WHERE id IN (${Prisma.join(ids)})`


I use MySql 8.0.27, and I really need more documentation to understand why that doesn't work

ty
Was this page helpful?