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=
"#Redis Command Reference">Redis Command Reference
</a><br> <a href=
"#Connection handling">Connection handling
</a><br> <a href=
"#Commands operating on string values">Commands operating on string values
</a><br> <a href=
"#Commands operating on the key space">Commands operating on the key space
</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=
"#Multiple databases handling commands">Multiple databases handling commands
</a><br> <a href=
"#Sorting">Sorting
</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 <h1><a name=
"Redis Command Reference">Redis Command Reference
</a></h1>Every command name links to a specific wiki page describing the behavior of the command.
<h2><a name=
"Connection handling">Connection handling
</a></h2><ul><li> <a href=
"QuitCommand.html">QUIT
</a> <code name=
"code" class=
"python">close the connection
</code></li><li> <a href=
"AuthCommand.html">AUTH
</a> <code name=
"code" class=
"python">simple password authentication if enabled
</code></li></ul>
30 <h2><a name=
"Commands operating on string values">Commands operating on string values
</a></h2><ul><li> <a href=
"SetCommand.html">SET
</a> <i>key
</i> <i>value
</i> <code name=
"code" class=
"python">set a key to a string value
</code></li><li> <a href=
"GetCommand.html">GET
</a> <i>key
</i> <code name=
"code" class=
"python">return the string value of the key
</code></li><li> <a href=
"GetsetCommand.html">GETSET
</a> <i>key
</i> <i>value
</i> <code name=
"code" class=
"python">set a key to a string returning the old value of the key
</code></li><li> <a href=
"MgetCommand.html">MGET
</a> <i>key1
</i> <i>key2
</i> ...
<i>keyN
</i> <code name=
"code" class=
"python">multi-get, return the strings values of the keys
</code></li><li> <a href=
"SetnxCommand.html">SETNX
</a> <i>key
</i> <i>value
</i> <code name=
"code" class=
"python">set a key to a string value if the key does not exist
</code></li><li> <a href=
"IncrCommand.html">INCR
</a> <i>key
</i> <code name=
"code" class=
"python">increment the integer value of key
</code></li><li> <a href=
"IncrCommand.html">INCRBY
</a> <i>key
</i> <i>integer
</i><code name=
"code" class=
"python"> increment the integer value of key by integer
</code></li><li> <a href=
"IncrCommand.html">DECR
</a> <i>key
</i> <code name=
"code" class=
"python">decrement the integer value of key
</code></li><li> <a href=
"IncrCommand.html">DECRBY
</a> <i>key
</i> <i>integer
</i> <code name=
"code" class=
"python">decrement the integer value of key by integer
</code></li><li> <a href=
"ExistsCommand.html">EXISTS
</a> <i>key
</i> <code name=
"code" class=
"python">test if a key exists
</code></li><li> <a href=
"DelCommand.html">DEL
</a> <i>key
</i> <code name=
"code" class=
"python">delete a key
</code></li><li> <a href=
"TypeCommand.html">TYPE
</a> <i>key
</i> <code name=
"code" class=
"python">return the type of the value stored at key
</code></li></ul>
31 <h2><a name=
"Commands operating on the key space">Commands operating on the key space
</a></h2><ul><li> <a href=
"KeysCommand.html">KEYS
</a> <i>pattern
</i> <code name=
"code" class=
"python">return all the keys matching a given pattern
</code></li><li> <a href=
"RandomkeyCommand.html">RANDOMKEY
</a> <code name=
"code" class=
"python">return a random key from the key space
</code></li><li> <a href=
"RenameCommand.html">RENAME
</a> <i>oldname
</i> <i>newname
</i> <code name=
"code" class=
"python">rename the old key in the new one, destroing the newname key if it already exists
</code></li><li> <a href=
"RenamenxCommand.html">RENAMENX
</a> <i>oldname
</i> <i>newname
</i> <code name=
"code" class=
"python">rename the old key in the new one, if the newname key does not already exist
</code></li><li> <a href=
"DbsizeCommand.html">DBSIZE
</a> <code name=
"code" class=
"python">return the number of keys in the current db
</code></li><li> <a href=
"ExpireCommand.html">EXPIRE
</a> <code name=
"code" class=
"python">set a time to live in seconds on a key
</code></li></ul>
32 <h2><a name=
"Commands operating on lists">Commands operating on lists
</a></h2><ul><li> <a href=
"RpushCommand.html">RPUSH
</a> <i>key
</i> <i>value
</i> <code name=
"code" class=
"python">Append an element to the tail of the List value at key
</code></li><li> <a href=
"RpushCommand.html">LPUSH
</a> <i>key
</i> <i>value
</i> <code name=
"code" class=
"python">Append an element to the head of the List value at key
</code></li><li> <a href=
"LlenCommand.html">LLEN
</a> <i>key
</i> <code name=
"code" class=
"python">Return the length of the List value at key
</code></li><li> <a href=
"LrangeCommand.html">LRANGE
</a> <i>key
</i> <i>start
</i> <i>end
</i> <code name=
"code" class=
"python">Return a range of elements from the List at key
</code></li><li> <a href=
"LtrimCommand.html">LTRIM
</a> <i>key
</i> <i>start
</i> <i>end
</i> <code name=
"code" class=
"python">Trim the list at key to the specified range of elements
</code></li><li> <a href=
"LindexCommand.html">LINDEX
</a> <i>key
</i> <i>index
</i> <code name=
"code" class=
"python">Return the element at index position from the List at key
</code></li><li> <a href=
"LsetCommand.html">LSET
</a> <i>key
</i> <i>index
</i> <i>value
</i> <code name=
"code" class=
"python">Set a new value as the element at index position of the List at key
</code></li><li> <a href=
"LremCommand.html">LREM
</a> <i>key
</i> <i>count
</i> <i>value
</i> <code name=
"code" class=
"python">Remove the first-N, last-N, or all the elements matching value from the List at key
</code></li><li> <a href=
"LpopCommand.html">LPOP
</a> <i>key
</i> <code name=
"code" class=
"python">Return and remove (atomically) the first element of the List at key
</code></li><li> <a href=
"LpopCommand.html">RPOP
</a> <i>key
</i> <code name=
"code" class=
"python">Return and remove (atomically) the last element of the List at key
</code></li></ul>
33 <h2><a name=
"Commands operating on sets">Commands operating on sets
</a></h2><ul><li> <a href=
"SaddCommand.html">SADD
</a> <i>key
</i> <i>member
</i> <code name=
"code" class=
"python">Add the specified member to the Set value at key
</code></li><li> <a href=
"SremCommand.html">SREM
</a> <i>key
</i> <i>member
</i> <code name=
"code" class=
"python">Remove the specified member from the Set value at key
</code></li><li> <a href=
"ScardCommand.html">SCARD
</a> <i>key
</i> <code name=
"code" class=
"python">Return the number of elements (the cardinality) of the Set at key
</code></li><li> <a href=
"SismemberCommand.html">SISMEMBER
</a> <i>key
</i> <i>member
</i> <code name=
"code" class=
"python">Test if the specified value is a member of the Set at key
</code></li><li> <a href=
"SinterCommand.html">SINTER
</a> <i>key1
</i> <i>key2
</i> ...
<i>keyN
</i> <code name=
"code" class=
"python">Return the intersection between the Sets stored at key1, key2, ..., keyN
</code></li><li> <a href=
"SinterstoreCommand.html">SINTERSTORE
</a> <i>dstkey
</i> <i>key1
</i> <i>key2
</i> ...
<i>keyN
</i> <code name=
"code" class=
"python">Compute the intersection between the Sets stored at key1, key2, ..., keyN, and store the resulting Set at dstkey
</code></li><li> <a href=
"SunionCommand.html">SUNION
</a> <i>key1
</i> <i>key2
</i> ...
<i>keyN
</i> <code name=
"code" class=
"python">Return the union between the Sets stored at key1, key2, ..., keyN
</code></li><li> <a href=
"SunionstoreCommand.html">SUNIONSTORE
</a> <i>dstkey
</i> <i>key1
</i> <i>key2
</i> ...
<i>keyN
</i> <code name=
"code" class=
"python">Compute the union between the Sets stored at key1, key2, ..., keyN, and store the resulting Set at dstkey
</code></li><li> <a href=
"SmembersCommand.html">SMEMBERS
</a> <i>key
</i> <code name=
"code" class=
"python">Return all the members of the Set value at key
</code></li></ul>
34 <h2><a name=
"Multiple databases handling commands">Multiple databases handling commands
</a></h2><ul><li> <a href=
"SelectCommand.html">SELECT
</a> <i>index
</i> <code name=
"code" class=
"python">Select the DB having the specified index
</code></li><li> <a href=
"MoveCommand.html">MOVE
</a> <i>key
</i> <i>dbindex
</i> <code name=
"code" class=
"python">Move the key from the currently selected DB to the DB having as index dbindex
</code></li><li> <a href=
"FlushdbCommand.html">FLUSHDB
</a> <code name=
"code" class=
"python">Remove all the keys of the currently selected DB
</code></li><li> <a href=
"FlushallCommand.html">FLUSHALL
</a> <code name=
"code" class=
"python">Remove all the keys from all the databases
</code></li></ul>
35 <h2><a name=
"Sorting">Sorting
</a></h2><ul><li> <a href=
"SortCommand.html">SORT
</a> <i>key
</i> BY
<i>pattern
</i> LIMIT
<i>start
</i> <i>end
</i> GET
<i>pattern
</i> ASC|DESC ALPHA
<code name=
"code" class=
"python">Sort a Set or a List accordingly to the specified parameters
</code></li></ul>
36 <h2><a name=
"Persistence control commands">Persistence control commands
</a></h2><ul><li> <a href=
"SaveCommand.html">SAVE
</a> <code name=
"code" class=
"python">Synchronously save the DB on disk
</code></li><li> <a href=
"BgsaveCommand.html">BGSAVE
</a> <code name=
"code" class=
"python">Asynchronously save the DB on disk
</code></li><li> <a href=
"LastsaveCommand.html">LASTSAVE
</a> <code name=
"code" class=
"python">Return the UNIX time stamp of the last successfully saving of the dataset on disk
</code></li><li> <a href=
"ShutdownCommand.html">SHUTDOWN
</a> <code name=
"code" class=
"python">Synchronously save the DB on disk, then shutdown the server
</code></li></ul>
37 <h2><a name=
"Remote server control commands">Remote server control commands
</a></h2><ul><li> <a href=
"InfoCommand.html">INFO
</a> <code name=
"code" class=
"python">Provide information and statistics about the server
</code></li><li> <a href=
"MonitorCommand.html">MONITOR
</a> <code name=
"code" class=
"python">Dump all the received requests in real time
</code></li></ul>