twinlogix / typetta

Node.js ORM written in TypeScript for type lovers.
https://twinlogix.github.io/typetta/
Apache License 2.0
108 stars 4 forks source link

Add the ability to filter an entity based on a condition of a relation. #13

Open minox86 opened 2 years ago

minox86 commented 2 years ago

There should be the possibility to add a condition that returns a record only if some/every/none of its related entities satisfy another given condition.

minox86 commented 2 years ago

I think this is not low priority, contrariwise I think this should be a functionality included in the next milestone (after Beta January 2022)

edobrb commented 2 years ago

it might not make much sense to have such a filter, you would be able to do the same with a double query using Typetta's current API. Can anyone formulate an example query where this type of filter comes in handy?

minox86 commented 2 years ago

As discussed in person, this functionality is important and useful. Some examples: