Skip to content

UPDATE EDGE

UPDATE EDGE <src_vid> -> <dest_vid> [@<rank>] OF <edge_type> SET <update_properties> [WHEN <condition>] [YIELD <properties>]

Use UPDATE EDGE to update properties on an edge. The UPDATE EDGE statement only updates one edge at a time.

Nebula Graph supports compare-and-set (CAS).

NOTE: WHEN and YIELD are optional.

  • update_properties is the properties of the edge to be updated. For example, e1.col1 = $^.e1.col2 + 1 means to update e1.col1 to e1.col2+1.

    NOTE:  $^ indicates the edge to be updated.

  • condition is some constraints. Only when the condition is met, UPDATE is executed successfully. condition supports expression operations.
  • properties is the properties to be returned, YIELD returns the latest updated values.

Consider the following example:

nebula> UPDATE EDGE "player100" -> "team204"@0 \
        OF serve \
        SET start_year = start_year + 1;

Last update: March 16, 2021
Back to top