SETEX

Synopsis

SETEX key ttl_in_sec string_value

This command sets the value of key to be string_value, and sets the key to expire in ttl_in_sec seconds.

Return value

Returns status string.

Examples

$ SETEX yugakey 10 "Yugabyte"
"OK"
$ GET yugakey
"Yugabyte"
$ TTL yugakey
(integer) 10

See also

append, set, psetex, get, getrange, getset, incr, incrby, setrange, strlen