APPEND

AttentionThis page documents an earlier version. Go to the latest (v2.1)version.

Synopsis

APPEND key string_valueThis 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

You can do this as shown below.

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

See Also

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