EdgeQL Tutorial

Sets

Subtopics

There are a couple of basic set operators in EdgeQL: union and distinct.

union merges two multi-sets together. This may result in duplicate entries:

Input
Run
Output Objects
Press the 'Run' button to evaluate the input

distinct gets rid of duplicate entries producing a proper set:

Input
Run
Output Objects
Press the 'Run' button to evaluate the input

Sets cannot be elements of other sets in EdgeQL, so instead the nested syntax is equivalent to a union. This is also consistent with the notion that everything is a set, including singleton literal values:

Input
Run
Output Objects
Press the 'Run' button to evaluate the input
Input
Run
Output Objects
Press the 'Run' button to evaluate the input