X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/7f4e28e75046104599a5d83c493fdfd78f93ab49..4eddb121563a9e50cf2ee66e2a0ff7c186dd696a:/doc/AppendCommand.html diff --git a/doc/AppendCommand.html b/doc/AppendCommand.html new file mode 100644 index 00000000..c2d8ed5b --- /dev/null +++ b/doc/AppendCommand.html @@ -0,0 +1,48 @@ + + + + + + + +
+ + + +
+
+ +AppendCommand: Contents
  APPEND _key_ _value_
    Return value
    Examples +
+ +

AppendCommand

+ +
+ +
+ +
+ #sidebar StringCommandsSidebar

APPEND _key_ _value_

+Time complexity: O(1). 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 the key already exists and is a string, this command appends theprovided value at the end of the string.If the key does not exist it is created and set as an empty string, soAPPEND will be very similar to SET in this special case.
+

Return value

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

Examples

+redis> exists mykey
+(integer) 0
+redis> append mykey "Hello "
+(integer) 6
+redis> append mykey "World"
+(integer) 11
+redis> get mykey
+"Hello World"
+
+ +
+ +
+
+ + +