Skip to content

Commit

Permalink
[doc]add if exists in dropping schema (#1511)
Browse files Browse the repository at this point in the history
Co-authored-by: dutor <[email protected]>
  • Loading branch information
amber-moe and dutor committed Jan 7, 2020
1 parent c377391 commit 8a69880
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# DROP EDGE 语法

```ngql
DROP EDGE <edge_type_name>
DROP EDGE [IF EXISTS] <edge_type_name>
```

仅支持有 DROP 权限的用户进行此操作。

删除边可使用 `IF EXISTS` 关键字,这个关键字会自动检测对应的边是否存在,如果存在则删除,如果不存在则直接返回。

此操作将移除指定类型的所有边。

此操作仅删除 Schema 信息,硬盘中所有文件及目录均**未被直接删除**,数据会在下次 compaction 时删除。
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# DROP SPACE 语法

```ngql
DROP SPACE <space_name<>
DROP SPACE [IF EXISTS] <space_name>
```

仅支持有 DROP 权限的用户进行此操作。

DROP SPACE 将删除指定 space 内的所有点和边。

删除图空间可使用 `IF EXISTS` 关键字,这个关键字会自动检测对应的图空间是否存在,如果存在则删除,如果不存在则直接返回。

其他 space 不受影响。

该语句不会立即删除存储引擎中的所有文件和目录(并释放磁盘空间)。删除操作取决于不同存储引擎的实现。
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# DROP TAG 语法

```ngql
DROP TAG <tag_name>
DROP TAG [IF EXISTS] <tag_name>
```

仅支持有 DROP 权限的用户进行此操作。
> 请谨慎进行此操作。
删除标签可使用 `IF EXISTS` 关键字,这个关键字会自动检测对应的标签是否存在,如果存在则删除,如果不存在则直接返回。

一个节点可以有一个或多个标签(类型)。

删除所有标签后,节点将不可访问,同时与节点连接的边也不可使用。
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Drop Edge Syntax

```ngql
DROP EDGE <edge_type_name>
DROP EDGE [IF EXISTS] <edge_type_name>
```

You must have the DROP privilege for the edge type.

You can use the `If EXISTS` keywords when dropping edges. This keyword automatically detects if the corresponding edge exists. If it exists, it will be deleted. Otherwise, no edge is deleted.

This statement removes all the edges (connections) within the specific edge type.

This operation only deletes the Schema data, all the files and directories in the disk are NOT deleted directly, data is deleted in the next compaction.
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Drop Space Syntax

```ngql
DROP SPACE <space_name>
DROP SPACE [IF EXISTS] <space_name>
```

You must have the DROP privilege for the graph space.

DROP SPACE deletes everything (all the vertices, edges, indices, and properties) in the specific space.

You can use the `If EXISTS` keywords when dropping spaces. This keyword automatically detects if the corresponding space exists. If it exists, it will be deleted. Otherwise, no space is deleted.

Other spaces remain unchanged.

This statement does not immediately remove all the files and directories in the storage engine (and release disk space). The deletion depends on the implementation of different storage engines.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Drop Tag Syntax

```ngql
DROP TAG <tag_name>
DROP TAG [IF EXISTS] <tag_name>
```

You must have the DROP privilege for the tag.

> Be careful with this statement.
You can use the `If EXISTS` keywords when dropping tags. This keyword automatically detects if the corresponding tag exists. If it exists, it will be deleted. Otherwise, no tag is deleted.

A vertex can have either only one tag (types) or multiple tags (types).

In the former case, such a vertex can NOT be accessible after the statement, and edges connected with such vertex may result in DANGLING.
Expand Down

0 comments on commit 8a69880

Please sign in to comment.