DEBUG OBJECT
Since 1.2.1Server
Syntax
DEBUG OBJECT keyDescribes 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 atis always0x0, andrefcount1.encodingis the oneOBJECT ENCODINGgives:embstr,int,listpackand the rest.serializedlengthis the length of the key'sDUMPpayload, not of Redis's RDB form.lruandlru_seconds_idleare0unless an LRU or LFU eviction policy, orkey-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