PSETEX

This page documents the preview (v2.21) version. Preview includes features under active development and is for development and testing only. For production, use the stable (v2024.1) version.

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

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

See also

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