Boolean
RESP3prefix: # · client type: bool / Boolean / true/false
RESP3 booleans encode true and false explicitly: #t\r\n and #f\r\n. In RESP2, boolean-semantic commands returned integers (1=true, 0=false). RESP3 booleans let clients receive proper boolean types for commands like SISMEMBER, HEXISTS, and EXPIRE without knowing the command's boolean-integer convention.
Details
RESP3 boolean values: #t\r\n – true #f\r\n – false
In RESP2, EXISTS and SISMEMBER returned :1 or :0. Clients that received these replies had to know the command name to interpret them as booleans rather than counts. RESP3 makes the type explicit.
Client implementations for languages without boolean types (C): should use 0/1 integers and document the type.
In Redis 7.2+, commands that previously returned 1/0 for boolean semantics (SISMEMBER, HEXISTS, EXPIRE, PERSIST, etc.) return #t/#f when the client has upgraded to RESP3.
Wire encoding
#t\r\n # true #f\r\n # false
Type information
| Prefix byte | # |
| Version | RESP3 |
| Client type | bool / Boolean / true/false |
| Specification | RESP3 specification (GitHub) → |