PEXPIRE

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

PEXPIRE key timeout

This command works exactly like EXPIRE but the time to live of the key is specified in milliseconds instead of seconds.

Return value

Returns integer reply, specifically 1 if the timeout was set and 0 if key does not exist.

Examples

$ SET yugakey "Yugabyte"
"OK"
$ PEXPIRE yugakey 10000
(integer) 1
$ PTTL yugakey
(integer) 9995

See also

expire, ttl, pttl, set