There's a workaround for filtering based on relation fields for findOne()
/find()
methods that I've discovered recently. The problem with filtering related table fields only exists for ObjectLiteral
-style where
, while string conditions work perfectly.
Assume that we have two entities – User
and Role
, user belongs to one role, role has many users:
@Entity()