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

support ttl in ms #2702

Merged
merged 5 commits into from
Apr 23, 2023
Merged
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
7 changes: 6 additions & 1 deletion docs-2.0/3.ngql-guide/8.clauses-and-options/ttl-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ nGQL 支持的 TTL 选项如下。
|选项|说明|
|:---|:---|
|`ttl_col`|指定要设置存活时间的属性。属性的数据类型必须是`int`或者`timestamp`。|
|`ttl_duration`|指定时间戳差值,单位:秒。时间戳差值必须为 64 位非负整数。属性值和时间戳差值之和如果小于当前时间戳,属性就会过期。如果`ttl_duration`为`0`,属性永不过期。|
|`ttl_duration`|指定时间戳差值,默认单位:秒。时间戳差值必须为 64 位非负整数。属性值和时间戳差值之和如果小于当前时间戳,属性就会过期。如果`ttl_duration`为`0`,属性永不过期。<br/>可在配置文件`nebula-storaged.conf`(默认路径`/usr/local/nightly/etc/`)中设置`ttl_use_ms`为`true`将默认单位设为毫秒。|

!!! caution

- 在设置`ttl_use_ms`为`true`前,请确保没有为属性设置 TTL,否则会因为过期时间缩短,导致数据被错误地删除。
- 在设置`ttl_use_ms`为`true`后,即设置`ttl_duration`的默认单位为毫秒后,`ttl_col`的默认单位仍然为秒,它的数据类型必须是`int`,并且需要手动转换属性值为毫秒。例如设置`ttl_col`为`a`,则需要将`a`的值转换为毫秒,如当`a`的值为`now()`,则需要将`a`的值设置为`now() * 1000`。

## 属性过期

Expand Down