APPEND

This page documents the preview (v2.21) version. Preview includes features under active development and is for development and testing only. For production, use the stable (v2024.1) version.

Synopsis

APPEND key string_value

This command appends a value to the end of the string that is associated with the given key.

  • If the key already exists, the given string_value is appended to the end of the string value that is associated with the key.
  • If the key does not exist, it is created and associated with an empty string.
  • If the key is associated with a non-string value, an error is raised.

Return value

Returns the length of the resulted string after appending.

Examples

$ GET yugakey
"Yuga"
$ APPEND yugakey "Byte"
8
$ GET yugakey
"Yugabyte"

See also

get, getrange, getset, incr, incrby, set, setrange, strlen