Skip to content

DROP EDGE

DROP EDGE [IF EXISTS] <edge_type_name>

DROP EDGE drops an edge type with the given name in a graph space. You must have the DROP privilege for the graph space. To drop an edge type in a specific graph space, you must use the graph space first.

NOTE: Before you drop an edge type, make sure that the edge type does not have any indexes. Otherwise, a conflict error ([ERROR (-8)]: Conflict!) is returned. To remove an index, see DROP INDEX.

An edge can have only one edge type. After you drop it, the edge CANNOT be accessible. The edge is deleted in the next compaction.

Edge type name

  • IF EXISTS: Dropping a non-existent edge type causes an error. You can use the IF EXISTS option to conditionally drop the edge type and avoid the error.

    NOTE: The edge type existence detection here compares only the edge type names (excluding properties).

  • edge_type_name: Specifies the edge type name that you want to drop. You can drop only one edge type in one statement.

Example

nebula> CREATE EDGE e1(p1 string, p2 int);

nebula> DROP EDGE e1;

Last update: March 31, 2021
Back to top