APPEND
The amortized time complexity is O(1) assuming the appended value is small and the already present value is of any size, since the dynamic string library used by Redis will double the free space available on every reallocation.
If 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, so APPEND will be similar to SET in this special case.
Syntax
APPEND key value
Time complexity: O(1).
Complete Guide to Redis Commands
Redis is an open-source, advanced key-value store and an apt solution for building high-performance, scalable web applications. Redis has three main peculiarities that set it apart:
- Redis holds its database entirely in the memory, using the disk only for persistence.
- Redis has a relatively rich set of data types compared to many key-value data stores.
- Redis can replicate data to any number of slaves.
Table of Content
- 1. KEY-VALUE OPERATIONS
- 1.1) SET:
- 1.2) GET:
- 1.4) DEL:
- 1.4) EXISTS:
- 1.5) TTL:
- 1.6) EXPIRE :
- 1.7) INCR
- 1.8) DECR
- 1.9) APPEND
- 2. LISTS:
- 2.1) LPUSH
- 2.2) RPUSH
- 2.3) LPOP
- 2.4) RPOP
- 2.5) LLEN
- 2.5) LRANGE
- 3. SETS:
- 3.1) “sadd” command:
- 3.2) “smembers” command:
- 3.3) “scard” command:
- 3.4) “sismember” command:
- 3.5) “sdiff” command:
- 3.6) “sdiffstore” command:
- 3.7) “sinter” command:
- 3.8) “sinterstore” command:
- 3.9) “sunion” command:
- 3.10) “sunionstore” command:
- 3.11) “srem” command:
- 4. HASHES:
- 4.1) HSET (Hash Set):
- 4.2) HGET (Hash Get):
- 4.3) HDEL (Hash Delete):
- 4.4) HGETALL (Hash Get All):
- 4.5) HKEYS (Hash Keys):
- 4.6) HVALS (Hash Values):
- 5. PUB/SUB:
- 5.1) PUBLISH
- 5.2) SUBSCRIBE
- 5.3) UNSUBSCRIBE
- 6. OTHER COMMANDS:
- 6.1) SELECT
- 6.2) FLUSHDB
- 6.3) SAVE
- 6.4) BGSAVE
Contact Us