]> git.saurik.com Git - redis.git/blame - doc/AppendCommand.html
replication asynchronous SYNC information in INFO output
[redis.git] / doc / AppendCommand.html
CommitLineData
aed57a31 1
2<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
3<html>
4 <head>
5 <link type="text/css" rel="stylesheet" href="style.css" />
6 </head>
7 <body>
8 <div id="page">
9
10 <div id='header'>
11 <a href="index.html">
12 <img style="border:none" alt="Redis Documentation" src="redis.png">
13 </a>
14 </div>
15
16 <div id="pagecontent">
17 <div class="index">
18<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
19<b>AppendCommand: Contents</b><br>&nbsp;&nbsp;<a href="#APPEND _key_ _value_">APPEND _key_ _value_</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Examples">Examples</a>
20 </div>
21
22 <h1 class="wikiname">AppendCommand</h1>
23
24 <div class="summary">
25
26 </div>
27
28 <div class="narrow">
29 &iuml;&raquo;&iquest;#sidebar <a href="StringCommandsSidebar.html">StringCommandsSidebar</a><h1><a name="APPEND _key_ _value_">APPEND _key_ _value_</a></h1>
30<i>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.</i><blockquote>If the <i>key</i> already exists and is a string, this command appends theprovided value at the end of the string.If the <i>key</i> does not exist it is created and set as an empty string, soAPPEND will be very similar to SET in this special case.</blockquote>
31<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer reply</a>, specifically the total length of the string after the append operation.<h2><a name="Examples">Examples</a></h2><pre class="codeblock python" name="code">
32redis&gt; exists mykey
33(integer) 0
34redis&gt; append mykey &quot;Hello &quot;
35(integer) 6
36redis&gt; append mykey &quot;World&quot;
37(integer) 11
38redis&gt; get mykey
39&quot;Hello World&quot;
40</pre>
41
42 </div>
43
44 </div>
45 </div>
46 </body>
47</html>
48