TcaplusDB Client - setttl Command
For TcaplusDB Client Instructions, see Document.
1. Function Descriptions
Set the time to live of a record (Time To Live, TTL, precision is milliseconds).
The TTL of a record will continue to decrease with the passage of time after setting. When the TTL of a record is exhausted, the system will delete this record.
The getttl command can only set the TTL of one record at a time. It does not support setting the TTL of multiple records at a time.
2. Initial Version
3.50.0
3. Command Syntax
setttl [table] ttl=[TTL] where key1 = 1 and key2 = "abc";
Parameter description:
Parameter | Required or not | Limitations | Description |
---|---|---|---|
table | Yes | None | Table Name |
key | Yes | For TDR table, the values of all primary key fields must be filled in | Primary key field |
TTL | Yes | The maximum value cannot exceed half of the maximum value of uint64_t, that is, the maximum value of ttl is ULONG_MAX/2. If it exceeds this value, the interface will be forced to set it to this value | TTL in milliseconds |
4. Command Example
See Table Definition Example for table definition.
Set the record TTL of 2000 milliseconds.
tcaplus> setttl test_table ttl=2000 where gameid = 1 and itemid = 2 and name = "abc";
Set time to live successfully.
5. Common Errors
Refer to Common Errors.
6. Related Documents
[TDR Generic Table][C++ SDK] Interface Description for Setting Record Expiration.
[TDR Generic Table][Go SDK] Interface Description for Setting Record Expiration.
[PB Generic Table][C++ SDK] Interface Description for Setting Record Expiration.
[PB Generic Table][Go SDK] Interface Description for Setting Record Expiration.