Skip to content

PIPE Syntax

One major difference between nGQL and SQL is how sub-queries are composed.

In SQL, sub-queries are nested (embedded) to form a statement. Meanwhile, nGQL uses shell style PIPE (|).

Examples

nebula> GO FROM 100 OVER follow YIELD follow._dst AS dstid, $$.player.name AS Name | \
GO FROM $-.dstid OVER follow YIELD follow._dst, follow.degree, $-.Name

The destination (vertex) id will be given as the default value if no YIELD is used.

But if YIELD is declared explicitly, (the default value) id will not be given.

The alias name mentioned right after placeholder $-. must be defined in the previous YIELD statement, such as dstid or Name as shown in the above example.


Last update: April 8, 2021