APPEND
APPEND key value
- Group
- String
- Complexity
- O(1) amortized
- Arity
- 3 (exactly, counting the command name)
- Flags
- write, fast
- Keys
- first 1, last 1, step 1
- HotKV Cloud
- All plans
- On-Premise
- no license needed
APPEND adds value to the end of the string at key. When the key does not
exist it is created with value as its content, as SET
would. The key keeps its time to live.
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
| Always | Integer: the length of the string after the append | Integer |
Errors:
WRONGTYPEwhen the key holds a value that is not a string.ERR string exceeds maximum allowed size (proto-max-bulk-len)when the result would be longer thanproto-max-bulk-len(512 MB by default).
Examples
Section titled “Examples”127.0.0.1:6379> APPEND log "boot;"(integer) 5127.0.0.1:6379> APPEND log "ready;"(integer) 11127.0.0.1:6379> GET log"boot;ready;"Compatibility
Section titled “Compatibility”Same as Redis 7 and Valkey 8.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.