Skip to content

DROP EDGE

DROP EDGE drops an edge type with the given name in a graph space.

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

This operation only deletes the Schema data. All the files or directories in the disk will not be deleted directly until the next compaction.

Prerequisites

  • Running the DROP EDGE statement requires some privileges for the graph space. Otherwise, Nebula Graph throws an error.
  • Before you drop an edge type, make sure that the edge type does not have any indexes. Otherwise, the conflict error ([ERROR (-1005)]: Conflict!) will be returned. To drop an index, see DROP INDEX.

Syntax

DROP EDGE [IF EXISTS] <edge_type_name>
  • IF NOT EXISTS: Detects if the edge type that you want to drop exists. Only when it exists will it be dropped.
  • 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 IF NOT EXISTS e1(p1 string, p2 int);
nebula> DROP EDGE e1;

Last update: August 12, 2022