Back to Yugabyte Db

PSETEX

docs/content/stable/yedis/api/psetex.md

2026.1.0.0-b29622 B
Original Source

Synopsis

PSETEX key ttl_in_msec string_value

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

Return Value

Returns status string.

Examples

sh
$ PSETEX yugakey 1000 "Yugabyte"
"OK"
sh
$ GET yugakey
"Yugabyte"
sh
$ PTTL yugakey
(integer) 900

See also

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