OBJECT IDLETIME · Valkey

OBJECT IDLETIME

Returns the time since the last access to an object.

Usage

OBJECT IDLETIME key

Description

This command returns the time in seconds since the last access to the value stored at <key>.

The command is only available when the maxmemory-policy configuration directive is not set to one of the LFU policies.

Reply

One of the following:

Integer: the idle time in seconds.

Null: if key doesn’t exist.

Complexity

O(1)

ACL Categories

@keyspace @read @slow

History

See also

COPY, DEL, DUMP, EXISTS, EXPIRE, EXPIREAT, EXPIRETIME, KEYS, MIGRATE, MOVE, OBJECT, OBJECT ENCODING, OBJECT FREQ, OBJECT HELP, OBJECT REFCOUNT, PERSIST, PEXPIRE, PEXPIREAT, PEXPIRETIME, PTTL, RANDOMKEY, RENAME, RENAMENX, RESTORE, SCAN, SORT, SORT_RO, TOUCH, TTL, TYPE, UNLINK, WAIT, WAITAOF.