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, }, });
Was this page helpful?