w3resource

Redis String: APPEND key value

Description

Redis APPEND command is used to add some value in a key. If the key already exists and is a string, this command appends the value at the end of the string. If key does not exist it is created and set as an empty string,

Syntax:

Basic syntax of redis APPEND command is shown below:

redis 127.0.0.1:6379> APPEND KEY_NAME NEW_VALUE

Available since

2.0.0.

Return Value

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

Return Value Type

Integer

Example:

redis 127.0.0.1:6379> SET mykey "hello"
OK
redis 127.0.0.1:6379> APPEND mykey "w3resource"
(integer) 20
redis 127.0.0.1:6379> GET mykey 
"hello tutorialspoint"

Previous: DECRBY
Next: Redis Hashes HDEL



Follow us on Facebook and Twitter for latest update.