What's new in Valkey 9.0? Discover new features and improvements. Read the announcement.

OBJECT FREQ

Returns the logarithmic access frequency counter of an object.

Usage
OBJECT FREQ key
Complexity
O(1)
Since
4.0.0
ACL Categories
@keyspace, @read, @slow
Command flags
READONLY

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.

Replies

RESP2

One of the following: Integer reply: the counter's value. Nil reply: if key doesn't exist.

RESP3

One of the following: Integer reply: the counter's value. Null reply: if key doesn't exist.