mirror of
http://github.com/valkey-io/valkey
synced 2024-11-22 00:52:38 +00:00
49 lines
2.2 KiB
HTML
49 lines
2.2 KiB
HTML
|
|
||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||
|
<html>
|
||
|
<head>
|
||
|
<link type="text/css" rel="stylesheet" href="style.css" />
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="page">
|
||
|
|
||
|
<div id='header'>
|
||
|
<a href="index.html">
|
||
|
<img style="border:none" alt="Redis Documentation" src="redis.png">
|
||
|
</a>
|
||
|
</div>
|
||
|
|
||
|
<div id="pagecontent">
|
||
|
<div class="index">
|
||
|
<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
|
||
|
<b>AppendCommand: Contents</b><br> <a href="#APPEND _key_ _value_">APPEND _key_ _value_</a><br> <a href="#Return value">Return value</a><br> <a href="#Examples">Examples</a>
|
||
|
</div>
|
||
|
|
||
|
<h1 class="wikiname">AppendCommand</h1>
|
||
|
|
||
|
<div class="summary">
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="narrow">
|
||
|
#sidebar <a href="StringCommandsSidebar.html">StringCommandsSidebar</a><h1><a name="APPEND _key_ _value_">APPEND _key_ _value_</a></h1>
|
||
|
<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>
|
||
|
<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">
|
||
|
redis> exists mykey
|
||
|
(integer) 0
|
||
|
redis> append mykey "Hello "
|
||
|
(integer) 6
|
||
|
redis> append mykey "World"
|
||
|
(integer) 11
|
||
|
redis> get mykey
|
||
|
"Hello World"
|
||
|
</pre>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|
||
|
|