Skip to main content
_

Null

RESP3

prefix: _  ·  client type: nil / None / null / nullptr

RESP3 type – requires HELLO 3 at connection startup to activate. RESP2 clients will not receive this type.

RESP3 introduces a unified null type: _\r\n. This replaces RESP2's two null representations ($-1\r\n null bulk string and *-1\r\n null array), which were semantically identical but required clients to track which null form applied to which command.

Details

In RESP2, null could be represented as a null bulk string ($-1\r\n) or a null array (*-1\r\n). The two forms were semantically equivalent – neither conveyed any additional information – but clients had to handle both.

RESP3 unifies them into a single null type: _\r\n.

Client mapping: nil in Ruby, None in Python, null in JavaScript/Java, nullptr in C++.

This is a backward-incompatible change: if a client sends HELLO 3, it will receive _ instead of $-1 or *-1 from commands that return null. Client libraries that support RESP3 must handle the new _ type.

Wire encoding

Wire bytes (CRLF shown as \\r\\n)
_\r\n    # the only null type in RESP3

Type information

Prefix byte_
VersionRESP3
Client typenil / None / null / nullptr
SpecificationRESP3 specification (GitHub) →

Redis commands returning this type

GET (missing key)HGET (missing field)LPOP (empty list)

See Also