Select where one->many relation has at least one matching a condition

I'm having a hard time wrapping my head around Drizzle, coming from Prisma.

I'm trying to do something like this:

const games = await prisma.db.game.findMany({
    where: {
      products: {
        some: {
          hidden: false,
        },
      },
    },
    select: {
      id: true,
      name: true,
    },
  });


I can't seem to figure out how to do this in Drizzle. Could anyone give me some directions on getting it done? Thanks
Was this page helpful?