一、语法
setttl [table] ttl=[TTL] where key1 = 1 and key2 = "abc";
二、参数
| 参数 | 是否必填 | 限制条件 | 说明 |
| table | 是 | 无 | 表名 |
| TTL | 是 | 最大不能超过 uint64_t 最大值的一半,即 ttl 最大值为 ULONG_MAX/2,超过该值接口会强制设置为该值 | 生存时间,以毫秒为单位 |
| where 条件中的 key | 是 | 对于 tdr 表,必须填入所有 key 值 | 声明 key 的值,多个 key 值用 and 连接 |
三、错误
请参考 错误码列表。
四、返回信息
| 情况描述 | 返回信息 |
| 记录不存在或者已过期 | Record does not exist or has expired. |
| 设置失败 | Failed to set time to live. The error code is [error code] and the error message is [Error message]. |
| 设置成功 | Set time to live successfully. |
五、示例
设置2000毫秒的生存时间:
tcaplus> setttl mails ttl=2000 where key1 = 1 and key2 = "abc";Set time to live successfully.