Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

APPEND

Last updated
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.

Case RESP2 RESP3
Always Integer: the length of the string after the append Integer

Errors:

  • WRONGTYPE when 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 than proto-max-bulk-len (512 MB by default).
127.0.0.1:6379> APPEND log "boot;"
(integer) 5
127.0.0.1:6379> APPEND log "ready;"
(integer) 11
127.0.0.1:6379> GET log
"boot;ready;"

Same as Redis 7 and Valkey 8.

SETRANGE, STRLEN, GETRANGE, SET