© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
25 replies
neoney

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,
    },
  });
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
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

relation select query with where condition
Drizzle TeamDTDrizzle Team / help
3y ago
findMany conditional select one-to-one relation
Drizzle TeamDTDrizzle Team / help
2y ago
Many -> Many relation with additional where clause to make it One > Many
Drizzle TeamDTDrizzle Team / help
3y ago
one-to-many self-relation
Drizzle TeamDTDrizzle Team / help
2y ago