Skip to content

DELETE EDGE

The DELETE EDGE statement deletes one edge or multiple edges at a time. You can use DELETE EDGE together with pipe operators. For more information, see PIPE OPERATORS.

To delete all the outgoing edges for a vertex, please delete the vertex. For more information, see DELETE VERTEX.

Syntax

DELETE EDGE <edge_type> <src_vid> -> <dst_vid>[@<rank>] [, <src_vid> -> <dst_vid>[@<rank>] ...]

Caution

If no rank is specified, NebulaGraph only deletes the edge with rank 0. Delete edges with all ranks, as shown in the following example.

Examples

nebula> DELETE EDGE serve "player100" -> "team204"@0;

The following example shows that you can use DELETE EDGE together with pipe operators to delete edges that meet the conditions.

nebula> GO FROM "player100" OVER follow \
        WHERE dst(edge) == "team204" \
        YIELD src(edge) AS src, dst(edge) AS dst, rank(edge) AS rank \
        | DELETE EDGE follow $-.src->$-.dst @ $-.rank;

Last update: February 1, 2023