You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I've tried those kind of query, it returns ALL modelB, and only attach modelA when it fulfills that condition.
Instead, I want it to return ONLY modelB's whose modelA has type === "whatever". Is that possible?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Let's suppose two models, A and B, with its relations already set
Model A:
Model B:
Is it possible to query modelB with its relations (aka modelA), where modelA.type === "whatever"?
Example of query:
modelBRepository.find( { include: [ { relation: 'modelA', scope: { where: { type: "whatever" } } } ] })
When I've tried those kind of query, it returns ALL modelB, and only attach modelA when it fulfills that condition.
Instead, I want it to return ONLY modelB's whose modelA has type === "whatever". Is that possible?
Beta Was this translation helpful? Give feedback.
All reactions