Redis Dump Command

Redis Key

The Redis DUMP command is used to serialize the given key and return the serialized value.

Syntax

The basic syntax of the redis DUMP command is as follows:

redis 127.0.0.1:6379> DUMP KEY_NAME

Available Versions

>= 2.6.0

Return Value

If the key does not exist, nil is returned. Otherwise, the serialized value is returned.

Example

First, we create a key in redis and set a value.

redis> SET greeting "hello, dumping world!"
OK

Now use DUMP to serialize the key-value pair.

redis> DUMP greeting
"\x00\x15hello, dumping world!\x06\x00E\xa0Z\x82\xd8r\xc1\xde"

redis> DUMP not-exists-key
(nil)

Redis Key

Other Extensions