2 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN">
5 <link type=
"text/css" rel=
"stylesheet" href=
"style.css" />
12 <img style=
"border:none" alt=
"Redis Documentation" src=
"redis.png">
16 <div id=
"pagecontent">
18 <!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
19 <b>CommandReference: Contents
</b><br> <a href=
"#Categorized Command List">Categorized Command List
</a><br> <a href=
"#Connection handling">Connection handling
</a><br> <a href=
"#Commands operating on all value types">Commands operating on all value types
</a><br> <a href=
"#Commands operating on string values">Commands operating on string values
</a><br> <a href=
"#Commands operating on lists">Commands operating on lists
</a><br> <a href=
"#Commands operating on sets">Commands operating on sets
</a><br> <a href=
"#Commands operating on sorted zsets (sorted sets)">Commands operating on sorted zsets (sorted sets)
</a><br> <a href=
"#Commands operating on hashes">Commands operating on hashes
</a><br> <a href=
"#Sorting">Sorting
</a><br> <a href=
"#Transactions">Transactions
</a><br> <a href=
"#Publish/Subscribe">Publish/Subscribe
</a><br> <a href=
"#Persistence control commands">Persistence control commands
</a><br> <a href=
"#Remote server control commands">Remote server control commands
</a>
22 <h1 class=
"wikiname">CommandReference
</h1>
29 = Redis Command Reference =
<br/><br/>Every command name links to a specific wiki page describing the behavior of the command.
<h2><a name=
"Categorized Command List">Categorized Command List
</a></h2><h2><a name=
"Connection handling">Connection handling
</a></h2><table><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Command
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Parameters
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Description
</b> </td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"QuitCommand.html">QUIT
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> -
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> close the connection
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"AuthCommand.html">AUTH
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>password
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> simple password authentication if enabled
</td></tr></table>
30 <h2><a name=
"Commands operating on all value types">Commands operating on all value types
</a></h2><table><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Command
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Parameters
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Description
</b> </td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ExistsCommand.html">EXISTS
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> test if a key exists
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"DelCommand.html">DEL
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> delete a key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"TypeCommand.html">TYPE
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> return the type of the value stored at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"KeysCommand.html">KEYS
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>pattern
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> return all the keys matching a given pattern
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"RandomkeyCommand.html">RANDOMKEY
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> -
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> return a random key from the key space
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"RenameCommand.html">RENAME
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>oldname
</i> <i>newname
</i> </td><td style=
"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><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"RenamenxCommand.html">RENAMENX
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>oldname
</i> <i>newname
</i> </td><td style=
"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><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"DbsizeCommand.html">DBSIZE
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> -
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> return the number of keys in the current db
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ExpireCommand.html">EXPIRE
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> -
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> set a time to live in seconds on a key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ExpireCommand.html">PERSIST
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> -
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> remove the expire from a key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"TtlCommand.html">TTL
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> -
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> get the time to live in seconds of a key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SelectCommand.html">SELECT
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>index
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Select the DB with the specified index
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"MoveCommand.html">MOVE
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>dbindex
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Move the key from the currently selected DB to the
<i>dbindex
</i> DB
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"FlushdbCommand.html">FLUSHDB
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> -
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> Remove all the keys from the currently selected DB
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"FlushallCommand.html">FLUSHALL
</a></td><td style=
"border: 1px solid #aaa; padding: 5px;"> -
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> Remove all the keys from all the databases
</td></tr></table>
31 <h2><a name=
"Commands operating on string values">Commands operating on string values
</a></h2><table><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Command
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Parameters
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Description
</b> </td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SetCommand.html">SET
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>value
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Set a
<i>key
</i> to a string
<i>value
</i> </td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"GetCommand.html">GET
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return the string value of the
<i>key
</i> </td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"GetsetCommand.html">GETSET
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>value
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Set a key to a string returning the old value of the key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"MgetCommand.html">MGET
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key1
</i> <i>key2
</i> ...
<i>keyN
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Multi-get, return the strings values of the keys
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SetnxCommand.html">SETNX
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>value
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Set a key to a string value if the key does not exist
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SetexCommand.html">SETEX
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>time
</i> <i>value
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Set+Expire combo command
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"MsetCommand.html">MSET
</a> </td><td style=
"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><td style=
"border: 1px solid #aaa; padding: 5px;"> Set multiple keys to multiple values in a single atomic operation
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"MsetCommand.html">MSETNX
</a> </td><td style=
"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><td style=
"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><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"IncrCommand.html">INCR
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Increment the integer value of key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"IncrCommand.html">INCRBY
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>integer
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Increment the integer value of
<i>key
</i> by
<i>integer
</i> </td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"IncrCommand.html">DECR
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Decrement the integer value of key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"IncrCommand.html">DECRBY
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>integer
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Decrement the integer value of
<i>key
</i> by
<i>integer
</i> </td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"AppendCommand.html">APPEND
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>value
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Append the specified string to the string stored at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SubstrCommand.html">SUBSTR
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>start
</i> <i>end
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return a substring of a larger string
</td></tr></table>
32 <h2><a name=
"Commands operating on lists">Commands operating on lists
</a></h2><table><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Command
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Parameters
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Description
</b> </td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"RpushCommand.html">RPUSH
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>value
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Append an element to the tail of the List value at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"RpushCommand.html">LPUSH
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>value
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Append an element to the head of the List value at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"LlenCommand.html">LLEN
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return the length of the List value at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"LrangeCommand.html">LRANGE
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>start
</i> <i>end
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return a range of elements from the List at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"LtrimCommand.html">LTRIM
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>start
</i> <i>end
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Trim the list at key to the specified range of elements
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"LindexCommand.html">LINDEX
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>index
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return the element at index position from the List at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"LsetCommand.html">LSET
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>index
</i> <i>value
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Set a new value as the element at index position of the List at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"LremCommand.html">LREM
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>count
</i> <i>value
</i> </td><td style=
"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><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"LpopCommand.html">LPOP
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return and remove (atomically) the first element of the List at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"LpopCommand.html">RPOP
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return and remove (atomically) the last element of the List at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"BlpopCommand.html">BLPOP
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key1
</i> <i>key2
</i> ...
<i>keyN
</i> <i>timeout
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Blocking LPOP
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"BlpopCommand.html">BRPOP
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key1
</i> <i>key2
</i> ...
<i>keyN
</i> <i>timeout
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Blocking RPOP
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"RpoplpushCommand.html">RPOPLPUSH
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>srckey
</i> <i>dstkey
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return and remove (atomically) the last element of the source List stored at
<i>srckey
</i> and push the same element to the destination List stored at
<i>dstkey
</i> </td></tr></table>
33 <h2><a name=
"Commands operating on sets">Commands operating on sets
</a></h2><table><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Command
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Parameters
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Description
</b> </td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SaddCommand.html">SADD
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>member
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Add the specified member to the Set value at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SremCommand.html">SREM
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>member
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Remove the specified member from the Set value at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SpopCommand.html">SPOP
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Remove and return (pop) a random element from the Set value at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SmoveCommand.html">SMOVE
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>srckey
</i> <i>dstkey
</i> <i>member
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Move the specified member from one Set to another atomically
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ScardCommand.html">SCARD
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return the number of elements (the cardinality) of the Set at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SismemberCommand.html">SISMEMBER
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>member
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Test if the specified value is a member of the Set at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SinterCommand.html">SINTER
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key1
</i> <i>key2
</i> ...
<i>keyN
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return the intersection between the Sets stored at key1, key2, ..., keyN
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SinterstoreCommand.html">SINTERSTORE
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>dstkey
</i> <i>key1
</i> <i>key2
</i> ...
<i>keyN
</i> </td><td style=
"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><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SunionCommand.html">SUNION
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key1
</i> <i>key2
</i> ...
<i>keyN
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return the union between the Sets stored at key1, key2, ..., keyN
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SunionstoreCommand.html">SUNIONSTORE
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>dstkey
</i> <i>key1
</i> <i>key2
</i> ...
<i>keyN
</i> </td><td style=
"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><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SdiffCommand.html">SDIFF
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key1
</i> <i>key2
</i> ...
<i>keyN
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return the difference between the Set stored at key1 and all the Sets key2, ..., keyN
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SdiffstoreCommand.html">SDIFFSTORE
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>dstkey
</i> <i>key1
</i> <i>key2
</i> ...
<i>keyN
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Compute the difference between the Set key1 and all the Sets key2, ..., keyN, and store the resulting Set at dstkey
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SmembersCommand.html">SMEMBERS
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return all the members of the Set value at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SrandmemberCommand.html">SRANDMEMBER
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return a random member of the Set value at key
</td></tr></table>
34 <h2><a name=
"Commands operating on sorted zsets (sorted sets)">Commands operating on sorted zsets (sorted sets)
</a></h2><table><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Command
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Parameters
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Description
</b> </td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ZaddCommand.html">ZADD
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>score
</i> <i>member
</i> </td><td style=
"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><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ZremCommand.html">ZREM
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>member
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Remove the specified member from the Sorted Set value at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ZincrbyCommand.html">ZINCRBY
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>increment
</i> <i>member
</i> </td><td style=
"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><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ZrankCommand.html">ZRANK
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>member
</i> </td><td style=
"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><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ZrankCommand.html">ZREVRANK
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>member
</i> </td><td style=
"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><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ZrangeCommand.html">ZRANGE
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>start
</i> <i>end
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return a range of elements from the sorted set at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ZrangeCommand.html">ZREVRANGE
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>start
</i> <i>end
</i> </td><td style=
"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><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ZrangebyscoreCommand.html">ZRANGEBYSCORE
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>min
</i> <i>max
</i> </td><td style=
"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><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ZrangebyscoreCommand.html">ZCOUNT
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>min
</i> <i>max
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return the number of elements with score
>= min and score
<= max in the sorted set
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ZcardCommand.html">ZCARD
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return the cardinality (number of elements) of the sorted set at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ZscoreCommand.html">ZSCORE
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>element
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return the score associated with the specified element of the sorted set at key
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ZremrangebyrankCommand.html">ZREMRANGEBYRANK
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>min
</i> <i>max
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Remove all the elements with rank
>= min and rank
<= max from the sorted set
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ZremrangebyscoreCommand.html">ZREMRANGEBYSCORE
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>min
</i> <i>max
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Remove all the elements with score
>= min and score
<= max from the sorted set
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ZunionstoreCommand.html">ZUNIONSTORE / ZINTERSTORE
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>dstkey
</i> <i>N
</i> <i>key1
</i> ...
<i>keyN
</i> WEIGHTS
<i>w1
</i> ...
<i>wN
</i> AGGREGATE SUM|MIN|MAX
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> Perform a union or intersection over a number of sorted sets with optional weight and aggregate
</td></tr></table>
35 <h2><a name=
"Commands operating on hashes">Commands operating on hashes
</a></h2><table><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Command
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Parameters
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Description
</b> </td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"HsetCommand.html">HSET
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>field
</i> <i>value
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Set the hash field to the specified value. Creates the hash if needed.
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"HgetCommand.html">HGET
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>field
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Retrieve the value of the specified hash field.
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"HmgetCommand.html">HMGET
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>field1
</i> ...
<i>fieldN
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Get the hash values associated to the specified fields.
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"HmsetCommand.html">HMSET
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>field1
</i> <i>value1
</i> ...
<i>fieldN
</i> <i>valueN
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Set the hash fields to their respective values.
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"HincrbyCommand.html">HINCRBY
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>field
</i> <i>integer
</i> </td><td style=
"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><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"HexistsCommand.html">HEXISTS
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>field
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Test for existence of a specified field in a hash
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"HdelCommand.html">HDEL
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> <i>field
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Remove the specified field from a hash
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"HlenCommand.html">HLEN
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return the number of items in a hash.
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"HgetallCommand.html">HKEYS
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return all the fields in a hash.
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"HgetallCommand.html">HVALS
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return all the values in a hash.
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"HgetallCommand.html">HGETALL
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <i>key
</i> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return all the fields and associated values in a hash.
</td></tr></table>
36 <h2><a name=
"Sorting">Sorting
</a></h2><table><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Command
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Parameters
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Description
</b> </td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SortCommand.html">SORT
</a> </td><td style=
"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><td style=
"border: 1px solid #aaa; padding: 5px;"> Sort a Set or a List accordingly to the specified parameters
</td></tr></table>
37 <h2><a name=
"Transactions">Transactions
</a></h2><table><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Command
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Parameters
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Description
</b> </td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"MultiExecCommand.html">MULTI/EXEC/DISCARD/WATCH/UNWATCH
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> -
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> Redis atomic transactions
</td></tr></table>
38 <h2><a name=
"Publish/Subscribe">Publish/Subscribe
</a></h2><table><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Command
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Parameters
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Description
</b> </td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"PublishSubscribe.html">SUBSCRIBE/UNSUBSCRIBE/PUBLISH
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> -
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> Redis Public/Subscribe messaging paradigm implementation
</td></tr></table>
39 <h2><a name=
"Persistence control commands">Persistence control commands
</a></h2><table><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Command
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Parameters
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Description
</b> </td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SaveCommand.html">SAVE
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> -
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> Synchronously save the DB on disk
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"BgsaveCommand.html">BGSAVE
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> -
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> Asynchronously save the DB on disk
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"LastsaveCommand.html">LASTSAVE
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> -
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> Return the UNIX time stamp of the last successfully saving of the dataset on disk
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ShutdownCommand.html">SHUTDOWN
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> -
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> Synchronously save the DB on disk, then shutdown the server
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"BgrewriteaofCommand.html">BGREWRITEAOF
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> -
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> Rewrite the append only file in background when it gets too big
</td></tr></table>
40 <h2><a name=
"Remote server control commands">Remote server control commands
</a></h2><table><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Command
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Parameters
</b> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> <b>Description
</b> </td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"InfoCommand.html">INFO
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> -
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> Provide information and statistics about the server
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"MonitorCommand.html">MONITOR
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> -
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> Dump all the received requests in real time
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"SlaveofCommand.html">SLAVEOF
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> -
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> Change the replication settings
</td></tr><tr><td style=
"border: 1px solid #aaa; padding: 5px;"> <a href=
"ConfigCommand.html">CONFIG
</a> </td><td style=
"border: 1px solid #aaa; padding: 5px;"> -
</td><td style=
"border: 1px solid #aaa; padding: 5px;"> Configure a Redis server at runtime
</td></tr></table>