Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc]add if exists in dropping schema #1511

Merged
merged 2 commits into from
Jan 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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` 关键字,这个关键字会自动检测对应的边是否存在,如果存在则删除,如果不存在则直接返回。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

强调一下不存在不会再返回错误。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我觉得没有必要强调,直接返回就表明什么操作都不用做了。强调错误反而会让人误解。


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

此操作仅删除 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` 关键字,这个关键字会自动检测对应的图空间是否存在,如果存在则删除,如果不存在则直接返回。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上


其他 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` 关键字,这个关键字会自动检测对应的标签是否存在,如果存在则删除,如果不存在则直接返回。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上


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

删除所有标签后,节点将不可访问,同时与节点连接的边也不可使用。
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.


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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto


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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.


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