DELETE EDGE¶
DELETE EDGE <edge_type> <src_vid> -> <dst_vid>[@<rank>] [, <edge_type> <src_vid> -> <dst_vid>[@<rank>] ...]
Use DELETE EDGE
to delete edges. The DELETE EDGE
statement deletes one edge or multiple edges at a time. You can use DELETE EDGE
together with pipe. For more information about pipe, see Pipe operator.
Examples¶
nebula> DELETE EDGE serve "player100" -> "team200"@0;
This query deletes the serve
edge from "player100"
to "team200"
, of which the rank value is 0.
nebula> GO FROM "player100" OVER follow WHERE follow._dst == "team200" YIELD follow._src AS src, follow._dst AS dst, follow._rank AS rank | \
DELETE EDGE follow $-.src->$-.dst @ $-.rank;
This query shows that you can use DELETE EDGE
together with pipe. This query first traverses all the follow
edges with different rank values from "player100"
to "team200"
then deletes them.
To delete all the outgoing edges for a vertex, delete the vertex. For more information, see DELETE VERTEX.
Note
Atomic operation is not guaranteed during the entire process for now, so please retry when a failure occurs.
Last update: April 22, 2021