From 078e6aa53287ab7225d5b1eb11bac81253dfac05 Mon Sep 17 00:00:00 2001
From: Abby <78209557+abby-cyber@users.noreply.github.com>
Date: Mon, 3 Apr 2023 15:26:16 +0800
Subject: [PATCH 1/2] support-ttl-in-ms
---
docs-2.0/3.ngql-guide/8.clauses-and-options/ttl-options.md | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/docs-2.0/3.ngql-guide/8.clauses-and-options/ttl-options.md b/docs-2.0/3.ngql-guide/8.clauses-and-options/ttl-options.md
index 5f33b7c3ab1..917db3b314e 100644
--- a/docs-2.0/3.ngql-guide/8.clauses-and-options/ttl-options.md
+++ b/docs-2.0/3.ngql-guide/8.clauses-and-options/ttl-options.md
@@ -23,8 +23,7 @@ The native nGQL TTL feature has the following options.
|Option|Description|
|:---|:---|
|`ttl_col`|Specifies the property to set a timeout on. The data type of the property must be `int` or `timestamp`.|
-|`ttl_duration`|Specifies the timeout adds-on value in seconds. The value must be a non-negative int64 number. A property expires if the sum of its value and the `ttl_duration` value is smaller than the current timestamp. If the `ttl_duration` value is `0`, the property never expires.|
-
+|`ttl_duration`|Specifies the timeout adds-on value in seconds. The value must be a non-negative int64 number. A property expires if the sum of its value and the `ttl_duration` value is smaller than the current timestamp. If the `ttl_duration` value is `0`, the property never expires.
You can set `ttl_use_ms` to `true` in the configuration file `nebula-storaged.conf` (default path: `/usr/local/nightly/etc/`) to set the default unit to milliseconds. **Note: Before modifying the `ttl_use_ms` parameter, make sure that no TTL has been set for any property, as the expiration time change may cause data to be erroneously deleted.**|
## Data expiration and deletion
From 672eae2bd54605ca9ec97737072acbabf5c953e3 Mon Sep 17 00:00:00 2001
From: Abby <78209557+abby-cyber@users.noreply.github.com>
Date: Mon, 10 Apr 2023 14:09:40 +0800
Subject: [PATCH 2/2] add a caution of must be manually converting ttl_col to
milliseconds
---
.../3.ngql-guide/8.clauses-and-options/ttl-options.md | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/docs-2.0/3.ngql-guide/8.clauses-and-options/ttl-options.md b/docs-2.0/3.ngql-guide/8.clauses-and-options/ttl-options.md
index 917db3b314e..3c9222ebe9c 100644
--- a/docs-2.0/3.ngql-guide/8.clauses-and-options/ttl-options.md
+++ b/docs-2.0/3.ngql-guide/8.clauses-and-options/ttl-options.md
@@ -23,7 +23,14 @@ The native nGQL TTL feature has the following options.
|Option|Description|
|:---|:---|
|`ttl_col`|Specifies the property to set a timeout on. The data type of the property must be `int` or `timestamp`.|
-|`ttl_duration`|Specifies the timeout adds-on value in seconds. The value must be a non-negative int64 number. A property expires if the sum of its value and the `ttl_duration` value is smaller than the current timestamp. If the `ttl_duration` value is `0`, the property never expires.
You can set `ttl_use_ms` to `true` in the configuration file `nebula-storaged.conf` (default path: `/usr/local/nightly/etc/`) to set the default unit to milliseconds. **Note: Before modifying the `ttl_use_ms` parameter, make sure that no TTL has been set for any property, as the expiration time change may cause data to be erroneously deleted.**|
+|`ttl_duration`|Specifies the timeout adds-on value in seconds. The value must be a non-negative int64 number. A property expires if the sum of its value and the `ttl_duration` value is smaller than the current timestamp. If the `ttl_duration` value is `0`, the property never expires.
You can set `ttl_use_ms` to `true` in the configuration file `nebula-storaged.conf` (default path: `/usr/local/nightly/etc/`) to set the default unit to milliseconds.|
+
+!!! caution
+
+ - Before setting `ttl_use_ms` to `true`, make sure that no TTL has been set for any property, as shortening the expiration time may cause data to be erroneously deleted.
+
+ - After setting `ttl_use_ms` to `true`, which sets the default TTL unit to milliseconds, the data type of the property specified by `ttl_col` must be `int`, and the property value needs to be manually converted to milliseconds. For example, when setting `ttl_col` to `a`, you need to convert the value of `a` to milliseconds, such as when the value of `a` is `now()`, you need to set the value of `a` to `now() * 1000`.
+
## Data expiration and deletion