DELETE VERTEX¶
The DELETE VERTEX
statement deletes vertices and the related incoming and outgoing edges of the vertices.
The DELETE VERTEX
statement deletes one vertex or multiple vertices at a time. You can use DELETE VERTEX
together with pipes. For more information about pipe, see Pipe operator.
Note
DELETE VERTEX
deletes vertices and related edges directly.
DELETE TAG
deletes a tag with the given name on a specified vertex. When a vertex has only one tag,DELETE TAG
deletes the vertex and keeps the related edges.
Syntax¶
DELETE VERTEX <vid> [, <vid> ...];
Examples¶
This query deletes the vertex whose ID is "team1".
nebula> DELETE VERTEX "team1";
This query shows that you can use DELETE VERTEX
together with pipe to delete vertices.
nebula> GO FROM "player100" OVER serve WHERE serve.start_year == "2021" YIELD dst(edge) AS id | DELETE VERTEX $-.id;
Delete the process and the related edges¶
Nebula Graph traverses the incoming and outgoing edges related to the vertices and deletes them all. Then Nebula Graph deletes the vertices.
Caution
- Atomic deletion is not supported during the entire process for now. Please retry when a failure occurs to avoid partial deletion, which will cause pendent edges.
- Deleting a supernode takes a lot of time. To avoid connection timeout before the deletion is complete, you can modify the parameter
--storage_client_timeout_ms
innebula-graphd.conf
to extend the timeout period.
Last update: December 7, 2021