Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Redis Dump Command

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 Version

= 2.6.0

Return Value

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

Example

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



redis> SET greeting "hello, dumping world!"

OK

Now use DUMP to serialize the key value.



redis> DUMP greeting

"\x00\x15hello, dumping world!\x06\x00E\xa0Z\x82\xd8r\xc1\xde"



redis> DUMP not-exists-key

(nil)

Redis Key