dump.3valkey - Man Page

Returns a serialized representation of the value stored at a key.

Synopsis

DUMP key

Description

Serialize the value stored at key in a Valkey-specific format and return it to the user. The returned value can be synthesized back into a Valkey key using the valkey-restore(7) RESTORE command.

The serialization format is opaque and non-standard, however it has a few semantic characteristics:

The serialized value does NOT contain expire information. In order to capture the time to live of the current value the valkey-pttl(7) PTTL command should be used.

If key does not exist a nil bulk reply is returned.

Reply

Resp2

One of the following:

Resp3

One of the following:

Complexity

O(1) to access the key and additional O(NM) to serialize it, where N is the number of objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1M) where M is small, so simply O(1).

Acl Categories

@keyspace @read @slow

History

Examples

> SET mykey 10
OK
> DUMP mykey
"\x00\xc0\n\n\x00n\x9fWE\x0e\xaec\xbb"

See Also

copy(3valkey), del(3valkey), exists(3valkey), expire(3valkey), expireat(3valkey), expiretime(3valkey), keys(3valkey), migrate(3valkey), move(3valkey), object(3valkey), object-encoding(3valkey), object-freq(3valkey), object-help(3valkey), object-idletime(3valkey), object-refcount(3valkey), persist(3valkey), pexpire(3valkey), pexpireat(3valkey), pexpiretime(3valkey), pttl(3valkey), randomkey(3valkey), rename(3valkey), renamenx(3valkey), restore(3valkey), scan(3valkey), sort(3valkey), sort_ro(3valkey), touch(3valkey), ttl(3valkey), type(3valkey), unlink(3valkey), wait(3valkey), waitaof(3valkey)

Info

2025-10-21 9.0.0 Valkey Command Manual