Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

OBJECT

Last updated
OBJECT ENCODING key
OBJECT FREQ key
OBJECT IDLETIME key
OBJECT REFCOUNT key
OBJECT HELP
Group
Keys
Arity
-2 (at least 2 words, counting the command name)
Flags
read-only
Keys
first 2, last 2, step 1
HotKV Cloud
All plans
On-Premise
no license needed

OBJECT is a container for subcommands that report on a single key. Every subcommand except HELP replies with nil when the key does not exist.

Subcommand What it returns
OBJECT ENCODING The encoding name of the value
OBJECT FREQ The access frequency counter (LFU eviction policies only)
OBJECT IDLETIME Seconds since the key was last accessed (non-LFU policies only)
OBJECT REFCOUNT Always 1
OBJECT HELP A list of the subcommands with a short description of each

An unknown subcommand replies with ERR unknown subcommand '<name>'. Try OBJECT HELP., and a subcommand with the wrong number of arguments with ERR wrong number of arguments for 'object|<subcommand>' command.

127.0.0.1:6379> SET counter 42
OK
127.0.0.1:6379> OBJECT ENCODING counter
"int"
127.0.0.1:6379> OBJECT REFCOUNT counter
(integer) 1

The same subcommands as Redis 7 and Valkey 8.

TYPE, DEBUG, MEMORY USAGE