Feature Request: Add support for eqFn in relation definitions for dynamic matching #37
Closed
damienroche
started this conversation in
General
Replies: 2 comments 1 reply
-
|
This looks good, but I'm not sure about the name of the function. Maybe |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Custom filter for relations are available since 0.7 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, relations between entities are defined using a declarative structure like the following:
This works well for simple key-to-key equality
(e.g., item.itinerary === target.id).However, it becomes limiting when more complex logic is required — for example, when the source entity contains an array of IDs, or when the relation involves custom business logic.
Proposed Enhancement:
Introduce a new field,
eqFn, as an alternative to theon + eqpair.eqFnwould allow defining a custom function to determine whether a given item matches a target:Details
eqFnis exclusive withonandeq— wheneqFnis present, the others are ignored.on+eqremains unchanged.What do you think of this feature?
Beta Was this translation helpful? Give feedback.
All reactions