Skip to content

EdgeQL help is needed. "Link filtering" question. #8052

Answered by vpetrovykh
scorday asked this question in Q&A
Discussion options

You must be logged in to vote

Right, so what you want is to use coalescing comparison.
There are ?= and ?!= that do the kind of thing that you want:

Your expression (1) could be re-written like so:

select Project { * } filter .private_user.id ?!= <uuid>$arg;

Which will get you all the projects that don't match the argument id as their private_user.id. And an empty set id will also not match any id you pass, thus all projects without a private_user will also be returned by this query.

The reason why this is happening is that most basic operators when dealing with sets are applied to the cross-product of those sets (so all possible pair combinations). So select {0, 1, 2} + {10, 20} will get you {10, 20, 11, 21, 12, 22}.…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@scorday
Comment options

Answer selected by scorday
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants