OBJECT
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.
Examples
Section titled “Examples”127.0.0.1:6379> SET counter 42OK127.0.0.1:6379> OBJECT ENCODING counter"int"127.0.0.1:6379> OBJECT REFCOUNT counter(integer) 1Compatibility
Section titled “Compatibility”The same subcommands as Redis 7 and Valkey 8.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.