This command is used to set a time to live (TTL) in millisecond for a record. The set value will be reduced by the elapsed time. When the TTL value of a record is equal to 0, TcaplusDB will remove it. This command only takes effect on a single record.
setttl [table] =[ ] where key1 = 1 and key2 = "abc";
|TTL||Yes||The value cannot exceed half of the maximum value of
||Time to live in millisecond|
|Key in the WHERE clause||Yes||All key values are required for TDR table.||Key values need to be declared. Multiple key values are joined with
For more information, see Error Codes.
|The record does not exist or has expired.||Record does not exist or has expired.|
|Failed to set time to live.||Failed to set time to live. The error code is [error code] and the error message is [Error message].|
|Set time to live successfully.||Set time to live successfully.|
Set TTL to 2,000 milliseconds:
tcaplus> setttl mails ttl=2000 where key1 = 1 and key2 = "abc"; Set time to live successfully.