Skip to content

Pipe operator

OpenCypher compatibility

This page applies to nGQL extensions only.

Syntax

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

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

Examples

nebula> GO FROM "player100" OVER follow \
YIELD follow._dst AS dstid, $$.player.name AS Name |\
GO FROM $-.dstid OVER follow;

+-------------+
| follow._dst |
+-------------+
| "player101" |
+-------------+

If there is no YIELD clause to define the output, the destination vertex ID is returned by default. If a YIELD clause is applied, the output is defined by the YIELD clause.

You must define aliases in the YIELD clause for the reference operator $- to use, just like $-.dstid in the preceding example.


Last update: March 23, 2021