DEBUG OBJECT

Since 1.2.1Server

Syntax

DEBUG OBJECT key

Describes the value at key in Redis's form: its encoding, the length of its serialized form and when it was last used. Tools and tests written for Redis read it, mostly for the encoding; OBJECT ENCODING gives that alone.

  • Value at is always 0x0, and refcount 1.
  • encoding is the one OBJECT ENCODING gives: embstr, int, listpack and the rest.
  • serializedlength is the length of the key's DUMP payload, not of Redis's RDB form.
  • lru and lru_seconds_idle are 0 unless an LRU or LFU eviction policy, or key-access-tracking, is on.

A key past its time is shown while it is still there, and looking at it is not a use. Since 1.2.1; in 1.2.0 it replied with a fixed line, whatever the key. See DEBUG.

Reply

  • The description, as a simple string.
  • ERR no such key.

Examples

> RPUSH l a b c
(integer) 3
> DEBUG OBJECT l
Value at:0x0 refcount:1 encoding:listpack serializedlength:19 lru:0 lru_seconds_idle:0
> DEBUG OBJECT nokey
(error) ERR no such key