Null
RESP3prefix: _ · client type: nil / None / null / nullptr
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
_\r\n # the only null type in RESP3
Type information
| Prefix byte | _ |
| Version | RESP3 |
| Client type | nil / None / null / nullptr |
| Specification | RESP3 specification (GitHub) → |