提交 7f4e28e7 编写于 作者: A antirez

html doc updated

上级 0bd06e52
......@@ -26,7 +26,7 @@
</div>
<div class="narrow">
<h1><a name="Credits">Credits</a></h1><ul><li> The Redis server was designed and written by <a href="http://invece.org" target="_blank">Salvatore Sanfilippo (aka antirez)</a></li><li> <a href="http://brainspl.at/" target="_blank">Ezra Zygmuntowicz (aka ezmobius)</a> - Ruby client lib initial version and hacking</li><li> <a href="http://qix.it" target="_blank">Ludovico Magnocavallo (aka ludo)</a> - Python clinet lib</li><li> <a href="http://www.adroll.com/" target="_blank">Valentino Volonghi of Adroll</a> - Erlang client lib</li><li> <b>brettbender</b> - found and fixed a but in sds.c that caused the server to crash at least on 64 bit systems, and anyway to be buggy since we used the same vararg thing against vsprintf without to call va_start and va_end every time.</li><li> <a href="http://www.rot13.org/~dpavlin" target="_blank">Dobrica Pavlinusic</a> - Perl client lib</li><li> Brian Hammond - AUTH command implementation</li><li> <a href="http://www.clorophilla.net/" target="_blank">Daniele Alessandri</a> - Lua client lib</li><li> Corey Stup - C99 cleanups</li><li> Taylor Weibley - Ruby client hacking </li></ul>
<h1><a name="Credits">Credits</a></h1><ul><li> The Redis server was designed and written by <a href="http://invece.org" target="_blank">Salvatore Sanfilippo (aka antirez)</a></li><li> <a href="http://brainspl.at/" target="_blank">Ezra Zygmuntowicz (aka ezmobius)</a> - Ruby client lib initial version and hacking</li><li> <a href="http://qix.it" target="_blank">Ludovico Magnocavallo (aka ludo)</a> - Python clinet lib</li><li> <a href="http://www.adroll.com/" target="_blank">Valentino Volonghi of Adroll</a> - Erlang client lib</li><li> <b>brettbender</b> - found and fixed a but in sds.c that caused the server to crash at least on 64 bit systems, and anyway to be buggy since we used the same vararg thing against vsprintf without to call va_start and va_end every time.</li><li> <a href="http://www.rot13.org/~dpavlin" target="_blank">Dobrica Pavlinusic</a> - Perl client lib</li><li> Brian Hammond - AUTH command implementation</li><li> <a href="http://www.clorophilla.net/" target="_blank">Daniele Alessandri</a> - Lua client lib</li><li> Corey Stup - C99 cleanups</li><li> Taylor Weibley - Ruby client hacking </li><li> Bob Potter - Rearrange redisObject struct to reduce memory usage in 64bit environments</li></ul>
p.s. sorry to take this file in sync is hard in this early days. Please drop me an email if I forgot to add your name here!
</div>
......
......@@ -29,9 +29,8 @@
<h1><a name="LLEN _key_">LLEN _key_</a></h1>
<i>Time complexity: O(1)</i><blockquote>Return the length of the list stored at the specified key. If thekey does not exist zero is returned (the same behaviour as forempty lists). If the value stored at <i>key</i> is not a list an error is returned.</blockquote>
<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer reply</a>, specifically:<br/><br/><pre class="codeblock python" name="code">
The length of the list as an integer `&gt;=` 0 if the operation succeeded
-2 if the specified key does not hold a list value
</pre>Note that library clients should raise an error if -2 is returned by the Redis server instead to pass the negative value back to the caller.<h2><a name="See also">See also</a></h2>
The length of the list.
</pre><h2><a name="See also">See also</a></h2>
<ul><li> <a href="LlenCommand.html">LLEN</a></li><li> <a href="LrangeCommand.html">LRANGE</a></li><li> <a href="LtrimCommand.html">LTRIM</a></li><li> <a href="LdelCommand.html">LDEL</a></li><li> <a href="LindexCommand.html">LINDEX</a></li><li> <a href="LsetCommand.html">LSET</a></li></ul>
</div>
......
......@@ -30,8 +30,6 @@
<i>Time complexity: O(N) (with N being the length of the list)</i><blockquote>Remove the first <i>count</i> occurrences of the <i>value</i> element from the list.If <i>count</i> is zero all the elements are removed. If <i>count</i> is negativeelements are removed from tail to head, instead to go from head to tailthat is the normal behaviour. So for example LREM with count -2 and_hello_ as value to remove against the list (a,b,c,hello,x,hello,hello) willlave the list (a,b,c,hello,x). The number of removed elements is returnedas an integer, see below for more information aboht the returned value.</blockquote>
<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer Reply</a>, specifically:<br/><br/><pre class="codeblock python" name="code">
The number of removed elements if the operation succeeded
-1 if the specified key does not exist
-2 if the specified key does not hold a list value
</pre><h2><a name="See also">See also</a></h2>
<ul><li> <a href="LlenCommand.html">LLEN</a></li><li> <a href="LrangeCommand.html">LRANGE</a></li><li> <a href="LtrimCommand.html">LTRIM</a></li><li> <a href="LdelCommand.html">LDEL</a></li><li> <a href="LindexCommand.html">LINDEX</a></li><li> <a href="LsetCommand.html">LSET</a></li></ul>
</div>
......
......@@ -28,10 +28,10 @@
<div class="narrow">
<h1><a name="MOVE _key_ _dbindex_">MOVE _key_ _dbindex_</a></h1>
<blockquote>Move the specified key from the currently selected DB to the specifieddestination DB. Note that this command returns 1 only if the key wassuccessfully moved, and 0 if the target key was already there or if thesource key was not found at all, so it is possible to use MOVE as a lockingprimitive.</blockquote>
<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer reply</a>, specifically:<br/><br/>1 if the key was moved
<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer reply</a>, specifically:<br/><br/><pre class="codeblock python" name="code">
1 if the key was moved
0 if the key was not moved because already present on the target DB or was not found in the current DB.
-3 if the destination DB is the same as the source DB
-4 if the database index if out of range<h2><a name="See also">See also</a></h2>
</pre><h2><a name="See also">See also</a></h2>
<ul><li> <a href="SelectCommand.html">SELECT</a></li><li> <a href="RenameCommand.html">RENAME</a></li></ul>
</div>
......
......@@ -31,8 +31,6 @@
<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer reply</a>, specifically:<br/><br/><pre class="codeblock python" name="code">
1 if the key was renamed
0 if the target key already exist
-1 if the source key does not exist
-3 if source and destination keys are the same
</pre><h2><a name="See also">See also</a></h2>
<ul><li> <a href="RenameCommand.html">RENAME</a> is like RENAMENX but overwrite existing destionation key.</li></ul>
</div>
......
......@@ -16,7 +16,7 @@
<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>ReplyTypes: Contents</b><br>&nbsp;&nbsp;<a href="#Redis Reply Types">Redis Reply Types</a><br>&nbsp;&nbsp;<a href="#Status code reply">Status code reply</a><br>&nbsp;&nbsp;<a href="#Integer reply">Integer reply</a><br>&nbsp;&nbsp;<a href="#Bulk reply">Bulk reply</a><br>&nbsp;&nbsp;<a href="#Multi bulk reply">Multi bulk reply</a>
<b>ReplyTypes: Contents</b><br>&nbsp;&nbsp;<a href="#Redis Reply Types">Redis Reply Types</a><br>&nbsp;&nbsp;<a href="#Status code reply">Status code reply</a><br>&nbsp;&nbsp;<a href="#Error reply">Error reply</a><br>&nbsp;&nbsp;<a href="#Integer reply">Integer reply</a><br>&nbsp;&nbsp;<a href="#Bulk reply">Bulk reply</a><br>&nbsp;&nbsp;<a href="#Multi bulk reply">Multi bulk reply</a>
</div>
<h1 class="wikiname">ReplyTypes</h1>
......@@ -27,14 +27,12 @@
<div class="narrow">
<h1><a name="Redis Reply Types">Redis Reply Types</a></h1>Redis commands can reply to the client with four different kind of replies, you can find the protocol level specification of this replies in the <a href="ProtocolSpecification.html">Redis Protocol Specification</a>. This page is instead an higher level description of the four types of replies from the point of view of the final user.<h1><a name="Status code reply">Status code reply</a></h1>
Status code replies are in the form of a <b>+OK</b> from the server, or a <b>-ERR</b> followed by an error string. At the protocol level this replies are sent as a single line. Client libraries should return <i>true</i> on <b>OK</b>, and should raise an exception in form of an error that stops the execution of the program on <b>ERR</b> replies from server, because this kind of replies are used by operations that usually fails because of a programming error, an inconsistent DB, and so on.<h1><a name="Integer reply">Integer reply</a></h1>
At protocol level integer replies are single line replies in form of a decimal singed number. Redis commands returning <i>true</i> or <i>false</i> will use an integer reply and &quot;1&quot; and &quot;0&quot; as replies. A negative value in an integer reply is used to signal an error by all the commands, with the exception of <a href="IncrCommand.html">INCR</a>/<a href="IncrCommand.html">INCRBY</a>/<a href="IncrCommand.html">DECR</a>/<a href="IncrCommand.html">DECRBY</a> where negative return values are allowed (this command never fails).<br/><br/>All the integer replies using negative values to return errors will use the same values to signal the same errors:
<b> -1 key not found
</b> -2 key contains a value of the wrong type
<b> -3 source object and destination object are the same
</b> -4 out of range argument<br/><br/>Integer replies are usually passed by client libraries as integer values. On negative integer reply an exception should be raised (excluding the INCR family commands).<h1><a name="Bulk reply">Bulk reply</a></h1>
A bulk reply is a binary-safe reply that is used to return a single string value (string is not limited to alphanumerical strings, it may contain binary data of any kind). Client libraries will usually return a string as return value of Redis commands returning bulk replies. There is a special bulk reply that signal that the element does not exist. When this happens the client library should return 'nil', 'false', or some other special element that can be distinguished by an empty string.<h1><a name="Multi bulk reply">Multi bulk reply</a></h1>
While a bulk reply returns a single string value, multi bulk replies are used to return multiple values: lists, sets, and so on. Elements of a bulk reply can be missing (-1 length count at protocol level). Client libraries should return 'nil' or 'false' in order to make this elements distinguishable from empty strings. Client libraries should return multi bulk replies that are about ordered elements like list ranges as lists, and bulk replies about sets as hashes.
Status code replies are single line strings having the <b>+</b> character as first byte. The string to return to the client is simply verything that follows the first <b>+</b> character. For example the <a href="PingCommand.html">PING</a> command returns <b>+PONG</b>, that is the string &quot;PONG&quot;.<h1><a name="Error reply">Error reply</a></h1>
This is like a status code reply but the first character is <b>-</b> instead of <b>+</b>. The client library should raise an error for error replies and stop the execution of the program if the exception is not trapped, showing the error message (everything following the first <b>-</b> character). An example of error is &quot;-Error no such key&quot; or &quot;-foobar&quot;. Note that error replies will not collide with negative integer replies since integer replies are prefixed with the <b>:</b> character.<h1><a name="Integer reply">Integer reply</a></h1>
At protocol level integer replies are single line replies in form of a decimal singed number prefixed by a <b>:</b> character. For example <b>:10</b> is an integer reply. Redis commands returning <i>true</i> or <i>false</i> will use an integer reply with 0 or 1 as values where 0 is false and 1 is true.<br/><br/>Integer replies are usually passed by client libraries as integer values.<h1><a name="Bulk reply">Bulk reply</a></h1>
A bulk reply is a binary-safe reply that is used to return a binary safe single string value (string is not limited to alphanumerical strings, it may contain binary data of any kind). Client libraries will usually return a string as return value of Redis commands returning bulk replies. There is a special bulk reply that signal that the element does not exist. When this happens the client library should return 'nil', 'false', or some other special element that can be distinguished by an empty string.<h1><a name="Multi bulk reply">Multi bulk reply</a></h1>
While a bulk reply returns a single string value, multi bulk replies are used to return multiple values: lists, sets, and so on. Elements of a bulk reply can be missing. Client libraries should return 'nil' or 'false' in order to make this elements distinguishable from empty strings. Client libraries should return multi bulk replies that are about ordered elements like list ranges as lists, and bulk replies about sets as hashes or Sets if the implementation language has a Set type.
</div>
</div>
......
......@@ -31,7 +31,6 @@
<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer reply</a>, specifically:<br/><br/><pre class="codeblock python" name="code">
1 if the new element was added
0 if the new element was already a member of the set
-2 if the key contains a non set value
</pre><h2><a name="See also">See also</a></h2>
<ul><li> <a href="SremCommand.html">SREM</a></li><li> <a href="SismemberCommand.html">SISMEMBER</a></li><li> <a href="ScardCommand.html">SCARD</a></li><li> <a href="SmembersCommand.html">SMEMBERS</a></li><li> <a href="SinterCommand.html">SINTER</a></li><li> <a href="SinterstoreCommand.html">SINTERSTORE</a></li></ul>
</div>
......
......@@ -27,10 +27,9 @@
<div class="narrow">
<h1><a name="SCARD _key_">SCARD _key_</a></h1>
<i>Time complexity O(1)</i><blockquote>Return the set cardinality (number of elements). If the <i>key</i> does notexist 0 is returned, like for empty sets. If the <i>key</i> does not holda set value -1 is returned. Client libraries should raise an errorwhen -1 is returned instead to pass the value to the caller.</blockquote>
<i>Time complexity O(1)</i><blockquote>Return the set cardinality (number of elements). If the <i>key</i> does notexist 0 is returned, like for empty sets.</blockquote>
<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer reply</a>, specifically:<br/><br/><pre class="codeblock python" name="code">
the cardinality (number of elements) of the set as an integer `&gt;=` 0 if the operation succeeded
-2 if the specified key does not hold a set value
the cardinality (number of elements) of the set as an integer.
</pre><h2><a name="See also">See also</a></h2>
<ul><li> <a href="SremCommand.html">SREM</a></li><li> <a href="SismemberCommand.html">SISMEMBER</a></li><li> <a href="ScardCommand.html">SCARD</a></li><li> <a href="SmembersCommand.html">SMEMBERS</a></li><li> <a href="SinterCommand.html">SINTER</a></li><li> <a href="SinterstoreCommand.html">SINTERSTORE</a></li></ul>
</div>
......
......@@ -27,11 +27,10 @@
<div class="narrow">
<h1><a name="SISMEMBER _key_ _member_">SISMEMBER _key_ _member_</a></h1>
<i>Time complexity O(1)</i><blockquote>Return 1 if <i>member</i> is a member of the set stored at <i>key</i>, otherwise0 is returned. On error a negative value is returned. Client librariesshould raise an error when a negative value is returned instead to passthe value to the caller.</blockquote>
<i>Time complexity O(1)</i><blockquote>Return 1 if <i>member</i> is a member of the set stored at <i>key</i>, otherwise0 is returned.</blockquote>
<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer reply</a>, specifically:<br/><br/><pre class="codeblock python" name="code">
1 if the element is a member of the set
0 if the element is not a member of the set OR if the key does not exist
-2 if the key does not hold a set value
</pre><h2><a name="See also">See also</a></h2>
<ul><li> <a href="SremCommand.html">SREM</a></li><li> <a href="SismemberCommand.html">SISMEMBER</a></li><li> <a href="ScardCommand.html">SCARD</a></li><li> <a href="SmembersCommand.html">SMEMBERS</a></li><li> <a href="SinterCommand.html">SINTER</a></li><li> <a href="SinterstoreCommand.html">SINTERSTORE</a></li></ul>
</div>
......
......@@ -31,7 +31,6 @@
<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer reply</a>, specifically:<br/><br/><pre class="codeblock python" name="code">
1 if the new element was removed
0 if the new element was not a member of the set
-2 if the key does not hold a set value
</pre><h2><a name="See also">See also</a></h2>
<ul><li> <a href="SremCommand.html">SREM</a></li><li> <a href="SismemberCommand.html">SISMEMBER</a></li><li> <a href="ScardCommand.html">SCARD</a></li><li> <a href="SmembersCommand.html">SMEMBERS</a></li><li> <a href="SinterCommand.html">SINTER</a></li><li> <a href="SinterstoreCommand.html">SINTERSTORE</a></li></ul>
</div>
......
......@@ -28,7 +28,7 @@
<div class="narrow">
<h1><a name="TYPE _key_">TYPE _key_</a></h1>
<i>Time complexity: O(1)</i><blockquote>Return the type of the value stored at <i>key</i> in form of astring. The type can be one of &quot;none&quot;, &quot;string&quot;, &quot;list&quot;, &quot;set&quot;.&quot;none&quot; is returned if the key does not exist.</blockquote>
<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Single line reply</a>, specifically:<br/><br/><pre class="codeblock python" name="code">
<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Status code reply</a>, specifically:<br/><br/><pre class="codeblock python" name="code">
&quot;none&quot; if the key does not exist
&quot;string&quot; if the key contains a String value
&quot;list&quot; if the key contains a List value
......
......@@ -29,6 +29,7 @@
<h1><a name="Get the latest Redis source code">Get the latest Redis source code</a></h1><h2><a name="Unstable code">Unstable code</a></h2>
The development version of Redis is <a href="http://github.com/antirez/redis/tree/master" target="_blank">hosted here at Github</a>, have fun cloning the source code with Git. If you are not familar with Git just use the <b>download</b> button to get a tarball.<h2><a name="Stable code">Stable code</a></h2>
<b>Warning:</b> the development source code is only intended for people that want to develop Redis or absolutely need the latest features still not available on the stable releases. You may have a better experience with the <a href="http://code.google.com/p/redis/downloads/list" target="_blank">latest stable tarball</a>.
</div>
</div>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册