APPEND

Redis Developer Course Redis Cloud Service Redis-Gate Server

Append

If key already exists, this command appends the new value at the end of the old value. If key does not exist, APPEND is equivalent to SET command.
Usage is APPEND key value.

Return value

Integer reply: the length of the string after the append operation.

Example

command>set key1 Hello
result>OK
command>append key1 Redis
result>10
command>get key1
result>HelloRedis
command>append key2 "Hello World"     If the key does not exists, save(SET) the key and value
result>11
command>get key2
result>Hello World

Animation



Syntax

APPEND key value

  • Available since 2.0.0.
  • Time complexity(Logical processing time): O(1)
Related Commands SET
Clients for Java Jedis, Lettuce, Redisson
Clients for C Hiredis

To practice the command, click here to run Redis Web Client


<< MSETNX APPEND STRLEN >>

Click for a question or to see comments.  Comments :    Viewed :

Email 답글이 올라오면 이메일로 알려드리겠습니다.