Easy Tutorial
❮ Sorted Sets Zincrby Sets Spop ❯

Redis Dump Command

Redis Key

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

Syntax

The basic syntax for 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, it returns nil. Otherwise, it returns the serialized value.

Example

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

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

Now, use DUMP to serialize the key.

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

redis> DUMP not-exists-key
(nil)

Redis Key

❮ Sorted Sets Zincrby Sets Spop ❯