Open bestickley opened 4 years ago
I encountered the problem, I have a parent entity, and one to many child entities, I do join children eager in the controller, and filter children by some attribute, children.status != deleted, as a result if some (not all) children entities have such status, the parent entity is being filtered out. So are you looking into the same issue?
This would allow a user to specify a WHERE condition in an ON clause when joining a relation. This could be added on the
QueryJoin
type in @nestjsx/crud-request like so:export declare type QueryJoin = { field: string; select?: QueryFields; onFilter: QueryFilter; };
A
joinType
could also be added toonFilter
to specify left or inner join. Currently, there is no way to filter on just a relation (it affects the base entity) so this feature would fill that hole.
@bestickley I'm looking solution to this problem too. Could you advise the solution? I'm trying to customize builder.addSelect(select) in setJoin function.
@sokhorn-houn, unfortunately this isn't possible right now. I just brought it up as a feature request.
@sokhorn-houn, unfortunately this isn't possible right now. I just brought it up as a feature request.
@bestickley thank you so much.
This would allow a user to specify a WHERE condition in an ON clause when joining a relation. This could be added on the
QueryJoin
type in @nestjsx/crud-request like so:A
joinType
could also be added toonFilter
to specify left or inner join. Currently, there is no way to filter on just a relation (it affects the base entity) so this feature would fill that hole.