OBJECT FREQ · Valkey

OBJECT FREQ

Returns the logarithmic access frequency counter of an object.

Usage

OBJECT FREQ key

Description

This command returns the logarithmic access frequency counter of a Valkey object stored at <key>.

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

Reply RESP2

One of the following:

Integer reply: the counter’s value.

Nil reply: if key doesn’t exist.

Reply RESP3

One of the following:

Integer reply: the counter’s value.

Null reply: 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 HELP, OBJECT IDLETIME, OBJECT REFCOUNT, PERSIST, PEXPIRE, PEXPIREAT, PEXPIRETIME, PTTL, RANDOMKEY, RENAME, RENAMENX, RESTORE, SCAN, SORT, SORT_RO, TOUCH, TTL, TYPE, UNLINK, WAIT, WAITAOF.