Struggling to work with JSONB `where`

So I have a jsonb column in Postgres (Using the Neon HTTP driver), and I'm trying to run a query to filter out based on the jsonb column:

await db()
  .select({ id: sites.id })
  .from(sites)
  .where(sql`metadata @> '{"key":"${key}"}'::jsonb`)
  .then(takeFirst);


Neon keeps coming back with the following error:

NeonDbError: bind message supplies 1 parameters, but prepared statement "" requires 0
Was this page helpful?