Available since 2.6.0.

PEXPIRE key milliseconds

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

Return value

Integer reply, specifically:

  • 1 if the timeout was set.
  • 0 if key does not exist.

Examples

redis> SET mykey "Hello"
"OK"
redis> PEXPIRE mykey 1500
(integer) 1
redis> TTL mykey
(integer) 1
redis> PTTL mykey
(integer) 1498
redis>

Hierarchy

Constructors

Properties

blocking?: boolean
dataType?: DataType

Used for "database" commands to enforce type checking.

logger: Logger = ...
maxParams: number = 2

Maximum number of parameters allowed. -1 for no maximum.

minParams: number = 2

Minimum number of parameters require.

name: string = "exists"
pubSubAllowed?: boolean

Used when PUB/SUB is in effect.

sign?: number

Sign is used in commands with a compliment command. The only current example is INCR/DECR. Sign is 1 for INCR and -1 for DECR

txIgnore?: boolean

Used in transactions to enqueue a command.

Methods