EdgeQL help is needed. "Link filtering" question. #8052
-
Hello. I understand that my question is kinda basic, but I could not find any help in older discussions. I have this schema: ` type Project{ I tried:
I have project with no private_user in db, but every time i get empty results. What's wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Right, so what you want is to use coalescing comparison. Your expression (1) could be re-written like so:
Which will get you all the projects that don't match the argument id as their 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
|
Beta Was this translation helpful? Give feedback.
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:
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 aprivate_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}
.…