© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
1 reply
kiryl_ch

how to query based on relation?

I have many to many relation between Project and User table. How to querry all projects that user is into?
 db.query.projects.findMany({
    where:  ---> users include userId ?
    with: {
      users: true,
    },
  });
 db.query.projects.findMany({
    where:  ---> users include userId ?
    with: {
      users: true,
    },
  });
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

Query based on nested relation
Drizzle TeamDTDrizzle Team / help
2y ago
query based on deep relations
Drizzle TeamDTDrizzle Team / help
2y ago
How to filter query based on children table?
Drizzle TeamDTDrizzle Team / help
3y ago
Ordering by relation in relational query
Drizzle TeamDTDrizzle Team / help
3y ago