UPDATE EDGE Syntax¶
Nebula Graph supports UPDATE EDGE properties of an edge, as well as CAS operation and returning related properties. The UPDATE EDGE statement only updates one edge-type of an edge at a time.
UPDATE EDGE <edge> SET <update_columns> [WHEN <condition>] [YIELD <columns>]
NOTE: WHEN and YIELD are optional.
edgeis the edge to be updated, the syntax is<src> -> <dst> [@rank] OF <edge_type>.update_columnsis the properties of the edge to be updated.conditionis some constraints, only when met,UPDATEwill run successfully and expression operations are supported.columnsis the columns to be returned,YIELDreturns the latest updated values.
Consider the following example:
nebula> UPDATE EDGE 100 -> 200@0 OF serve SET start_year = serve.start_year + 1 \
YIELD $^.player.name AS name, serve.start_year AS start;