EXPIRE
Synopsis
EXPIRE key timeout
Set a timeout on key (in seconds). After the timeout has expired, the key will automatically be deleted.
Return value
Returns integer reply, specifically 1 if the timeout was set and 0 if key does not exist.
Examples
$ SET yugakey "Yugabyte"
"OK"
$ EXPIRE yugakey 10
(integer) 1
$ EXPIRE non-existent-key 10
(integer) 0
See also
当前内容版权归 YugabyteDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 YugabyteDB .