Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"(not) exists" expressions #647

Open
andrus opened this issue Sep 19, 2023 · 0 comments · May be fixed by #670
Open

"(not) exists" expressions #647

andrus opened this issue Sep 19, 2023 · 0 comments · May be fixed by #670

Comments

@andrus
Copy link
Contributor

andrus commented Sep 19, 2023

Would be great to support (not) exists Agrest expressions to filter on the contents of to-many relationships. E.g.:

// at least one related object is present
?exp=exists details

// no related objects are present
?exp=not exists details

// no related objects matching the condition are present
?exp=not exists (details.value between 5 and 6)

// at least one related object is present matching the condition. 
// Condition includes both root and related properties
?exp=exists (details.value = value)

Cayenne will not support this until 5.0 per https://issues.apache.org/jira/browse/CAY-2816 . But we can still add this syntax to Agrest expression parser and Java DSL, and translate it to Cayenne subqueries.

@m-dzianishchyts m-dzianishchyts linked a pull request Feb 8, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant