<b>CommandReference: Contents</b><br> <ahref="#Categorized Command List">Categorized Command List</a><br> <ahref="#Connection handling">Connection handling</a><br> <ahref="#Commands operating on all value types">Commands operating on all value types</a><br> <ahref="#Commands operating on string values">Commands operating on string values</a><br> <ahref="#Commands operating on lists">Commands operating on lists</a><br> <ahref="#Commands operating on sets">Commands operating on sets</a><br> <ahref="#Commands operating on sorted zsets (sorted sets)">Commands operating on sorted zsets (sorted sets)</a><br> <ahref="#Commands operating on hashes">Commands operating on hashes</a><br> <ahref="#Sorting">Sorting</a><br> <ahref="#Transactions">Transactions</a><br> <ahref="#Publish/Subscribe">Publish/Subscribe</a><br> <ahref="#Persistence control commands">Persistence control commands</a><br> <ahref="#Remote server control commands">Remote server control commands</a>
= Redis Command Reference =<br/><br/>Every command name links to a specific wiki page describing the behavior of the command.<h2><aname="Categorized Command List">Categorized Command List</a></h2><h2><aname="Connection handling">Connection handling</a></h2><table><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Command</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Parameters</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Description</b></td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="QuitCommand.html">QUIT</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> - </td><tdstyle="border: 1px solid #aaa; padding: 5px;"> close the connection </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="AuthCommand.html">AUTH</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>password</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> simple password authentication if enabled </td></tr></table>
<h2><aname="Commands operating on all value types">Commands operating on all value types</a></h2><table><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Command</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Parameters</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Description</b></td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="ExistsCommand.html">EXISTS</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> test if a key exists </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="DelCommand.html">DEL</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> delete a key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="TypeCommand.html">TYPE</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> return the type of the value stored at key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="KeysCommand.html">KEYS</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>pattern</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> return all the keys matching a given pattern </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="RandomkeyCommand.html">RANDOMKEY</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> - </td><tdstyle="border: 1px solid #aaa; padding: 5px;"> return a random key from the key space </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="RenameCommand.html">RENAME</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>oldname</i><i>newname</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> rename the old key in the new one, destroying the newname key if it already exists </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="RenamenxCommand.html">RENAMENX</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>oldname</i><i>newname</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> rename the <i>oldname</i> key to <i>newname</i>, if the <i>newname</i> key does not already exist </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="DbsizeCommand.html">DBSIZE</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> - </td><tdstyle="border: 1px solid #aaa; padding: 5px;"> return the number of keys in the current db </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="ExpireCommand.html">EXPIRE</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> - </td><tdstyle="border: 1px solid #aaa; padding: 5px;"> set a time to live in seconds on a key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="ExpireCommand.html">PERSIST</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> - </td><tdstyle="border: 1px solid #aaa; padding: 5px;"> remove the expire from a key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="TtlCommand.html">TTL</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> - </td><tdstyle="border: 1px solid #aaa; padding: 5px;"> get the time to live in seconds of a key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="SelectCommand.html">SELECT</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>index</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Select the DB with the specified index </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="MoveCommand.html">MOVE</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>dbindex</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Move the key from the currently selected DB to the <i>dbindex</i> DB </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="FlushdbCommand.html">FLUSHDB</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> - </td><tds
<h2><aname="Commands operating on string values">Commands operating on string values</a></h2><table><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Command</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Parameters</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Description</b></td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="SetCommand.html">SET</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>value</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Set a <i>key</i> to a string <i>value</i></td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="GetCommand.html">GET</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return the string value of the <i>key</i></td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="GetsetCommand.html">GETSET</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>value</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Set a key to a string returning the old value of the key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="SetnxCommand.html">SETNX</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>value</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Set a key to a string value if the key does not exist </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="SetexCommand.html">SETEX</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>time</i><i>value</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Set+Expire combo command </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="SetbitCommand.html">SETBIT</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>offset</i><i>value</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Set bit at <i>offset</i> to <i>value</i></td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="GetbitCommand.html">GETBIT</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>offset</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return bit value at <i>offset</i></td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="MsetCommand.html">MSET</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key1</i><i>value1</i><i>key2</i><i>value2</i> ... <i>keyN</i><i>valueN</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Set multiple keys to multiple values in a single atomic operation </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="MsetCommand.html">MSETNX</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key1</i><i>value1</i><i>key2</i><i>value2</i> ... <i>keyN</i><i>valueN</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Set multiple keys to multiple values in a single atomic operation if none of the keys already exist </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="MgetCommand.html">MGET</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key1</i><i>key2</i> ... <i>keyN</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Multi-get, return the strings values of the keys </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="IncrCommand.html">INCR</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Increment the integer value of key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="IncrCommand.html">INCRBY</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>integer</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Increment the integer value of <i>key</i> by <i>integer</i></td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="IncrCommand.html">DECR</a></td><tdstyle="border:1
<h2><aname="Commands operating on lists">Commands operating on lists</a></h2><table><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Command</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Parameters</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Description</b></td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="RpushCommand.html">RPUSH</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>value</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Append an element to the tail of the List value at key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="RpushCommand.html">LPUSH</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>value</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Append an element to the head of the List value at key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="LlenCommand.html">LLEN</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return the length of the List value at key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="LrangeCommand.html">LRANGE</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>start</i><i>end</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return a range of elements from the List at key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="LtrimCommand.html">LTRIM</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>start</i><i>end</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Trim the list at key to the specified range of elements </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="LindexCommand.html">LINDEX</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>index</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return the element at index position from the List at key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="LsetCommand.html">LSET</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>index</i><i>value</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Set a new value as the element at index position of the List at key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="LremCommand.html">LREM</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>count</i><i>value</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Remove the first-N, last-N, or all the elements matching value from the List at key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="LpopCommand.html">LPOP</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return and remove (atomically) the first element of the List at key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="LpopCommand.html">RPOP</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return and remove (atomically) the last element of the List at key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="BlpopCommand.html">BLPOP</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key1</i><i>key2</i> ... <i>keyN</i><i>timeout</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Blocking LPOP </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="BlpopCommand.html">BRPOP</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key1</i><i>key2</i> ... <i>keyN</i><i>timeout</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Blocking RPOP </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="RpoplpushCommand.html">RPOPLPUSH</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>srckey</i
<h2><aname="Commands operating on sets">Commands operating on sets</a></h2><table><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Command</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Parameters</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Description</b></td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="SaddCommand.html">SADD</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>member</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Add the specified member to the Set value at key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="SremCommand.html">SREM</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>member</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Remove the specified member from the Set value at key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="SpopCommand.html">SPOP</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Remove and return (pop) a random element from the Set value at key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="SmoveCommand.html">SMOVE</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>srckey</i><i>dstkey</i><i>member</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Move the specified member from one Set to another atomically </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="ScardCommand.html">SCARD</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return the number of elements (the cardinality) of the Set at key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="SismemberCommand.html">SISMEMBER</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>member</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Test if the specified value is a member of the Set at key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="SinterCommand.html">SINTER</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key1</i><i>key2</i> ... <i>keyN</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return the intersection between the Sets stored at key1, key2, ..., keyN </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="SinterstoreCommand.html">SINTERSTORE</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>dstkey</i><i>key1</i><i>key2</i> ... <i>keyN</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Compute the intersection between the Sets stored at key1, key2, ..., keyN, and store the resulting Set at dstkey </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="SunionCommand.html">SUNION</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key1</i><i>key2</i> ... <i>keyN</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return the union between the Sets stored at key1, key2, ..., keyN </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="SunionstoreCommand.html">SUNIONSTORE</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>dstkey</i><i>key1</i><i>key2</i> ... <i>keyN</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Compute the union between the Sets stored at key1, key2, ..., keyN, and store the resulting Set at dstkey </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="SdiffCommand.html">SDIFF</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key1</i><i>key2</i> ... <i>keyN</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return the difference between the Set stored at key1 and all the Sets key2, ..., keyN </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="SdiffstoreCommand.html">SDIFFSTORE</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>dstkey</i><i>k
<h2><aname="Commands operating on sorted zsets (sorted sets)">Commands operating on sorted zsets (sorted sets)</a></h2><table><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Command</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Parameters</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Description</b></td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="ZaddCommand.html">ZADD</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>score</i><i>member</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Add the specified member to the Sorted Set value at key or update the score if it already exist </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="ZremCommand.html">ZREM</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>member</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Remove the specified member from the Sorted Set value at key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="ZincrbyCommand.html">ZINCRBY</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>increment</i><i>member</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> If the member already exists increment its score by <i>increment</i>, otherwise add the member setting <i>increment</i> as score </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="ZrankCommand.html">ZRANK</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>member</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return the rank (or index) or <i>member</i> in the sorted set at <i>key</i>, with scores being ordered from low to high </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="ZrankCommand.html">ZREVRANK</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>member</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return the rank (or index) or <i>member</i> in the sorted set at <i>key</i>, with scores being ordered from high to low </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="ZrangeCommand.html">ZRANGE</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>start</i><i>end</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return a range of elements from the sorted set at key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="ZrangeCommand.html">ZREVRANGE</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>start</i><i>end</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return a range of elements from the sorted set at key, exactly like ZRANGE, but the sorted set is ordered in traversed in reverse order, from the greatest to the smallest score </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="ZrangebyscoreCommand.html">ZRANGEBYSCORE</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>min</i><i>max</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return all the elements with score >= min and score <= max (a range query) from the sorted set </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="ZrangebyscoreCommand.html">ZCOUNT</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>min</i><i>max</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return the number of elements with score >= min and score <= max in the sorted set </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="ZcardCommand.html">ZCARD</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return the cardinality (number of elements) of the sorted set at key </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="ZscoreCommand.html">ZSCORE</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>element</i></td><tdstyle="b
<h2><aname="Commands operating on hashes">Commands operating on hashes</a></h2><table><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Command</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Parameters</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Description</b></td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="HsetCommand.html">HSET</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>field</i><i>value</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Set the hash field to the specified value. Creates the hash if needed. </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="HgetCommand.html">HGET</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>field</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Retrieve the value of the specified hash field. </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="HmgetCommand.html">HMGET</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>field1</i> ... <i>fieldN</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Get the hash values associated to the specified fields. </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="HmsetCommand.html">HMSET</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>field1</i><i>value1</i> ... <i>fieldN</i><i>valueN</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Set the hash fields to their respective values. </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="HincrbyCommand.html">HINCRBY</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>field</i><i>integer</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Increment the integer value of the hash at <i>key</i> on <i>field</i> with <i>integer</i>. </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="HexistsCommand.html">HEXISTS</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>field</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Test for existence of a specified field in a hash </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="HdelCommand.html">HDEL</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i><i>field</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Remove the specified field from a hash </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="HlenCommand.html">HLEN</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return the number of items in a hash. </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="HgetallCommand.html">HKEYS</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return all the fields in a hash. </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="HgetallCommand.html">HVALS</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return all the values in a hash. </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="HgetallCommand.html">HGETALL</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return all the fields and associated values in a hash. </td></tr></table>
<h2><aname="Sorting">Sorting</a></h2><table><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Command</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Parameters</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Description</b></td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="SortCommand.html">SORT</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><i>key</i> BY <i>pattern</i> LIMIT <i>start</i><i>end</i> GET <i>pattern</i> ASC|DESC ALPHA </td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Sort a Set or a List accordingly to the specified parameters </td></tr></table>
<h2><aname="Persistence control commands">Persistence control commands</a></h2><table><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Command</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Parameters</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Description</b></td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="SaveCommand.html">SAVE</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> - </td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Synchronously save the DB on disk </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="BgsaveCommand.html">BGSAVE</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> - </td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Asynchronously save the DB on disk </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="LastsaveCommand.html">LASTSAVE</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> - </td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Return the UNIX time stamp of the last successfully saving of the dataset on disk </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="ShutdownCommand.html">SHUTDOWN</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> - </td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Synchronously save the DB on disk, then shutdown the server </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="BgrewriteaofCommand.html">BGREWRITEAOF</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> - </td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Rewrite the append only file in background when it gets too big </td></tr></table>
<h2><aname="Remote server control commands">Remote server control commands</a></h2><table><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Command</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Parameters</b></td><tdstyle="border: 1px solid #aaa; padding: 5px;"><b>Description</b></td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="InfoCommand.html">INFO</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> - </td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Provide information and statistics about the server </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="MonitorCommand.html">MONITOR</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> - </td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Dump all the received requests in real time </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="SlaveofCommand.html">SLAVEOF</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> - </td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Change the replication settings </td></tr><tr><tdstyle="border: 1px solid #aaa; padding: 5px;"><ahref="ConfigCommand.html">CONFIG</a></td><tdstyle="border: 1px solid #aaa; padding: 5px;"> - </td><tdstyle="border: 1px solid #aaa; padding: 5px;"> Configure a Redis server at runtime </td></tr></table>