{"id":43939,"date":"2015-09-21T14:17:57","date_gmt":"2015-09-21T11:17:57","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=43939"},"modified":"2023-12-06T14:51:11","modified_gmt":"2023-12-06T12:51:11","slug":"redis-commands-using-redis-command-line","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2015\/09\/redis-commands-using-redis-command-line.html","title":{"rendered":"Redis Commands \u2013 Using Redis Command Line"},"content":{"rendered":"<p><em>This article is part of our Academy Course titled <a href=\"http:\/\/www.javacodegeeks.com\/2015\/09\/redis-a-nosql-key-value-store.html\">Redis a NoSQL key-value store<\/a>.<\/em><\/p>\n<p><em>This is a crash course on Redis. You will learn how to install Redis and start up the server. Additionally, you will mess around with the Redis command line. More advanced topics follow, such as replication, sharding and clustering, while the integration of Redis with Spring Data is also explained. Check it out <a href=\"http:\/\/www.javacodegeeks.com\/2015\/09\/redis-a-nosql-key-value-store.html\">here<\/a>!<\/em><\/p>\n<div class=\"toc\">\n<h4>Table Of Contents<\/h4>\n<dl>\n<dt><a href=\"#introduction\">1. Introduction<\/a><\/dt>\n<dt><a href=\"#keys\">2. Keys<\/a><\/dt>\n<dt><a href=\"#strings\">3. Strings<\/a><\/dt>\n<dt><a href=\"#hashes\">4. Hashes<\/a><\/dt>\n<dt><a href=\"#lists\">5. Lists<\/a><\/dt>\n<dt><a href=\"#sets\">6. Sets<\/a><\/dt>\n<dt><a href=\"#sorted_sets\">7. Sorted Sets<\/a><\/dt>\n<dt><a href=\"#publish_subscribe\">8. Publish \/ Subscribe<\/a><\/dt>\n<dt><a href=\"#transactions\">9. Transactions<\/a><\/dt>\n<dt><a href=\"#scripting\">10. Scripting<\/a><\/dt>\n<dt><a href=\"#connection\">11. Connection<\/a><\/dt>\n<dt><a href=\"#server\">12. Server<\/a><\/dt>\n<\/dl>\n<\/div>\n<h2><a name=\"introduction\"><\/a>1. Introduction<\/h2>\n<p>Commands are the foundational concept of Redis. It\u2019s the only way clients communicate with the server. The set of Redis commands is so rich, that there are several categories of them. Each category corresponds to data structures (or a feature) it operates on:<\/p>\n<ul>\n<li>Keys<\/li>\n<li>Strings<\/li>\n<li>Hashes<\/li>\n<li>Lists<\/li>\n<li>Sets<\/li>\n<li>Sorted Sets<\/li>\n<li>Publish \/ Subscribe<\/li>\n<li>Transactions, Scripting<\/li>\n<\/ul>\n<p>Additionally, there are a couple of service commands to manage server configuration, connections and inspect the runtime behavior<\/p>\n<ul>\n<li>Connection<\/li>\n<li>Server<\/li>\n<\/ul>\n<p>In this tutorial we will continue to familiarize ourselves with Redis command line tool, <code>redis-cli<\/code> (<code>redis-cli.exe<\/code> on Windows), which we have briefly discussed in the first tutorial. In the next sections we will go over all Redis commands and try out most of them. Quick note ahead, to see the effects of some commands the two instances of <code>redis-cli<\/code> (<code>redis-cli.exe<\/code> on Windows) should be running.<\/p>\n<h1><a name=\"keys\"><\/a>2. Keys<\/h1>\n<p>Despite its rich features, Redis is still a key \/ value store. Every value stored in Redis could be retrieved using the respective key (or sometimes keys). This subsection gives the overview of generic operations over keys, independently of their values.<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>DEL key [key &#8230;]<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Deletes a key (or multiple keys). Command returns how many keys have been removed successfully.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists, the command deletes it.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/del\">http:\/\/redis.io\/commands\/del<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 1<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>DUMP key <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Returns a serialized version of the value stored at the specified key.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and is assigned the simple string \u201c<strong>value<\/strong>\u201d, the command returns its serialized representation.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/dump\">http:\/\/redis.io\/commands\/dump<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 2<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>EXISTS key <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Determines if a key exists. Returns 1 if key exists, 0 otherwise.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey1<\/code> exists and <code>mykey2<\/code> does not, the command returns <strong>1<\/strong> and <strong>0<\/strong> respectively.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/exists\">http:\/\/redis.io\/commands\/exists<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 3<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>EXPIRE key seconds <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Sets a key&#8217;s time to live in seconds. Once this time interval expires, key will be deleted. Command returns 1 if key exists and 0 otherwise.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists, its expiration time is set to 1 second.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/expire\">http:\/\/redis.io\/commands\/expire<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 4<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>EXPIREAT key timestamp <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Sets the expiration for a key as a UNIX timestamp. Once expiration time is reached, key will be deleted. Command returns 1 if key exists and 0 otherwise.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>EXPIRE<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/expireat\">http:\/\/redis.io\/commands\/expireat<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 5<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>KEYS pattern <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Finds all keys matching the given pattern. <strong>This command is very dangerous to execute on a live server because it can match the whole set of keys<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the keys <code>mykey1<\/code> and <code>mykey2<\/code> exist, the command returns them as match to <code>mykey<\/code>* pattern.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/keys\">http:\/\/redis.io\/commands\/keys<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 6<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>MIGRATE host port key destination-db timeout<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Atomically transfers a key from a Redis instance to another one.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and there is another instance of Redis server running on <code>localhost<\/code> and port <code>6378<\/code>, the <code>mykey<\/code> will transferred to database <strong>0<\/strong> with <strong>1000<\/strong> milliseconds (1 second) timeout. Please notice the <code>mykey<\/code> will be deleted from current Redis instance. If <code>mykey<\/code> doesn\u2019t exist, command returns <code>NOKEY<\/code> response.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/migrate\">http:\/\/redis.io\/commands\/migrate<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 7<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>MOVE key db <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Moves a key to another database. Command returns 1 if key exists and was moved properly and 0 otherwise.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists, it will be moved to database 2. Please notice the <code>mykey<\/code> will be deleted from current database.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/move\">http:\/\/redis.io\/commands\/move<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 8<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>OBJECT REFCOUNT key<br \/>\nOBJECT ENCODING key<br \/>\nOBJECT IDLETIME key<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Inspects the internals of Redis objects associated with keys:<\/p>\n<ul>\n<li><code>REFCOUNT<\/code> returns the number of references of the value associated with the specified key<\/li>\n<li><code>ENCODING<\/code> returns the kind of internal representation used in order to store the value associated with a key<\/li>\n<li><code>IDLETIME<\/code> returns the number of seconds since the object stored at the specified key is idle (not requested by read or write operations), in seconds.<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists, the command provides some intrinsic details, useful mostly for debugging purposes. See also <code>DEBUG OBJECT<\/code> command.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/object\">http:\/\/redis.io\/commands\/object<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 9<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>PERSIST key <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Removes the expiration from a key. Command returns 1 if key exists and has expiration (time to live) set and 0 otherwise.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and has expiration (time to live) set (see please <code>EXPIRE<\/code> command), the command removes expiration from it.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/persist\">http:\/\/redis.io\/commands\/persist<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 10<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>PEXPIRE key milliseconds <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Sets a key&#8217;s time to live in milliseconds. Once this time interval expires, key will be deleted. Command returns 1 if key exists and 0 otherwise.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>EXPIRE<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/pexpire\">http:\/\/redis.io\/commands\/pexpire<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 11<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>PEXPIREAT key milliseconds-timestamp <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Sets the expiration for a key as a UNIX timestamp specified in milliseconds. Once expiration time is reached, key will be deleted. Command returns 1 if key exists and 0 otherwise.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>EXPIREAT<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/pexpireat\">http:\/\/redis.io\/commands\/pexpireat<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 12<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>PTTL key <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets the time to live for a key in milliseconds. Command returns -2 if key does not exist, -1 if key exists but doesn\u2019t have expiration (time to live) set.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and has expiration (time to live) set to <strong>300<\/strong> seconds (see please <code>EXPIRE<\/code> command), the command returns the remaining time to live.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/pttl\">http:\/\/redis.io\/commands\/pttl<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 13<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>RANDOMKEY <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Returns a random key from the keyspace. Command returns nothing if there are not keys in keyspace.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the keys <code>mykey<\/code>, <code>mykey1<\/code> and <code>mykey2<\/code> exist, command returns randomly one of them.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/randomkey\">http:\/\/redis.io\/commands\/randomkey<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 14<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>RENAME key newkey <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Renames a key. If key <code>key<\/code> does not exist, command returns <code>ERR no such key<\/code>. Please notice, if the key <code>newkey<\/code> exists, its value will be replace with value of key <code>key<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists, it will be renamed to <code>mykey3<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/rename\">http:\/\/redis.io\/commands\/rename<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 15<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>RENAMENX key newkey <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Renames a key, only if the new key does not exist. If key <code>key<\/code> does not exist, command returns <code>ERR no such key<\/code>. Command returns 1 if key was renamed and 0 otherwise (in case key <code>newkey<\/code> exists).<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and <code>mykey4<\/code> does not exist, it will be renamed to <code>mykey4<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/renamenx\">http:\/\/redis.io\/commands\/renamenx<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 16<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>RESTORE key ttl serialized-value <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Creates a key using the provided serialized value, previously obtained using <code>DUMP<\/code>. If key <code>key<\/code> exists, command returns <code>ERR Target key name is busy<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Reusing the serialized value from <code>DUMP<\/code> command we have seen earlier, the command assigns to key <code>mykey2<\/code> value \u201c<strong>value<\/strong>\u201d.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/restore\">http:\/\/redis.io\/commands\/restore<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 17<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>TTL key <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets the time to live for a key. Command returns -2 if key does not exist, -1 if key exists but doesn\u2019t have expiration (time to live) set.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>PTTL<\/code> command.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/ttl\">http:\/\/redis.io\/commands\/ttl<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 18<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>TYPE key <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Determines the type stored at key. The command returns <code>none<\/code> if key doesn\u2019t exist.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and has value \u201c<strong>value<\/strong>\u201d assigned, the command returns <code>string<\/code> as a key type.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/type\">http:\/\/redis.io\/commands\/type<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 19<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SCAN cursor [MATCH pattern] [COUNT count] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Incrementally iterates the keys space. Iteration starts when the cursor is set to 0, and terminates when the cursor returned by the server is 0.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the keys <code>mykey<\/code>, <code>mykey1<\/code>, <code>mykey2<\/code> and <code>mykey3<\/code> exist, command returns a cursor over keyspace.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/scan\">http:\/\/redis.io\/commands\/scan<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 20<\/p>\n<\/div>\n<h2><a name=\"strings\"><\/a>3. Strings<\/h2>\n<p>Strings are the simplest type which could be store as a value of particular key. This subsection goes over Redis command specific to string data type.<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>APPEND key value <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Appends a value to a key. If key doesn\u2019t exist, it will be created and assigned this value. Command returns the new length of key\u2019s string value.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and has value \u201c<strong>value<\/strong>\u201d, yet another string \u201c<strong>value<\/strong>\u201d will be appended to it resulting into final value \u201cvaluevalue\u201d (with length of 10).<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/append\">http:\/\/redis.io\/commands\/append<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 21<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>BITCOUNT key [start] [end] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Counts set bits in a string. If key doesn\u2019t exists, command returns 0.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and has value \u201c<strong>value<\/strong>\u201d, the command returns 21 as the result.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/bitcount\">http:\/\/redis.io\/commands\/bitcount<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 22<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>BITOP AND destkey key [key &#8230;]<br \/>\nBITOP OR destkey key [key &#8230;]<br \/>\nBITOP XOR destkey key [key &#8230;]<br \/>\nBITOP NOT destkey key [key &#8230;]<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Performs bitwise operations between strings. Command returns the size of the string stored in the destination key that is equal to the size of the longest input string. Command returns 0 if key key doesn\u2019t exist.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the keys <code>mykey<\/code> and <code>mykey1<\/code> exist with values \u201c<strong>value<\/strong>\u201d and \u201c<strong>eulav<\/strong>\u201d respectively, command returns the length of resulting string <strong>(5)<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/bitop\">http:\/\/redis.io\/commands\/bitop<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 23<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>DECR key<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Decrements the integer value of a key by one. If key\u2019s value is not an integer, command returns <code>ERR value is not an integer or out of range<\/code>. If key doesn\u2019t exist, command assumes it has value 0 and decrements it.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming <code>mykey<\/code> exists and has value 100, the command decrements its value by 1 and returns new value 99.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/decr\">http:\/\/redis.io\/commands\/decr<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 24<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>DECRBY key decrement<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Decrements the integer value of a key by the given number. If key\u2019s value is not an integer, command returns <code>ERR value is not an integer or out of range<\/code>. If key doesn\u2019t exist, command assumes it has value 0 and decrements it by decrement.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>DECR<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/decrby\">http:\/\/redis.io\/commands\/decrby<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 25<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>GET key <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets the value of a key. Command returns <code>(nil)<\/code> if key doesn\u2019t exist.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming <code>mykey<\/code> exists and has value \u201c<strong>value<\/strong>\u201d, the command returns it.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/get\">http:\/\/redis.io\/commands\/get<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 26<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>GETBIT key offset<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Returns the bit value at offset in the string value stored at key. Command returns 0 if key <code>key<\/code> doesn\u2019t exist.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming <code>mykey<\/code> exists and has value \u201c<strong>value<\/strong>\u201d, the command returns <strong>1<\/strong> for offset of <strong>3<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/getbit\">http:\/\/redis.io\/commands\/getbit<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 27<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>GETRANGE key start end <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets a substring of the string stored at a key. Command returns \u201c\u201d (empty string) if key <code>key<\/code> doesn\u2019t exist. Please notice that indexing starts from 0.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming <code>mykey<\/code> exists and has value \u201c<strong>value<\/strong>\u201d, the command returns substring \u201c<strong>lue<\/strong>\u201d for range (2,5].<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/getrange\">http:\/\/redis.io\/commands\/getrange<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 28<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>GETSET key value <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Sets the string value of a key and returns its old value. If key <code>key<\/code> doesn\u2019t exist, the command returns <code>(nil)<\/code> as its old value (but assigns the new value anyway).<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming <code>mykey<\/code> exists and has value \u201c<strong>value<\/strong>\u201d, the command returns old value while assigning to the key a new value \u201c<strong>newvalue<\/strong>\u201d.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/getset\">http:\/\/redis.io\/commands\/getset<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 29<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>INCR key<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Increments the integer value of a key by one. If key\u2019s value is not an integer, command returns <code>ERR value is not an integer or out of range<\/code>. If key doesn\u2019t exist, command assumes it has value 0 and increments it.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>DECR<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/incr\">http:\/\/redis.io\/commands\/incr<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 30<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>INCRBY key increment <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Increments the integer value of a key by the given amount. If key\u2019s value is not an integer, command returns <code>ERR value is not an integer or out of range<\/code>. If key doesn\u2019t exist, command assumes it has value 0 and increments it by increment.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>DECR<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/incrby\">http:\/\/redis.io\/commands\/incrby<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 31<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>INCRBYFLOAT key increment <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Increments the float value of a key by the given amount. If key\u2019s value is not a float or integer, command returns <code>ERR value is not a valid float<\/code>. If key doesn\u2019t exist, command assumes it has value 0 and increments it by increment.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>DECR<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/incrbyfloat\">http:\/\/redis.io\/commands\/incrbyfloat<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 32<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>MGET key [key &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets the values of all the given keys. If one of the keys doesn\u2019t exist, command returns (nil) as its value. Very handy command to get value of multiple keys at once.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the keys <code>mykey1<\/code> and <code>mykey2<\/code> exist, the command returns their values.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/mget\">http:\/\/redis.io\/commands\/mget<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 33<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>MSET key value [key value &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Sets multiple keys to multiple values. Very handy command to set many keys at once. If any of the keys exists, its value will be overridden.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/mset\">http:\/\/redis.io\/commands\/mset<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 34<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>MSETNX key value [key value &#8230;]<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Sets multiple keys to multiple values, only if none of the keys exist.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>MSET<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/msetnx\">http:\/\/redis.io\/commands\/msetnx<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 35<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>PSETEX key milliseconds value <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Sets the value and expiration in milliseconds of a key. Very powerful combination of <code>SET<\/code> and <code>PEXPIRE<\/code> as one atomic command.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>SET<\/code> and <code>PEXPIRE<\/code> commands<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/psetex\">http:\/\/redis.io\/commands\/psetex<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 36<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SET key value [EX seconds] [PX milliseconds] [NX|XX] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Sets the string value of a key. Additional options allow to control command behavior:<\/p>\n<ul>\n<li><code>EX seconds<\/code>: sets the specified expire time, in seconds<\/li>\n<li><code>PX milliseconds<\/code>: set the specified expire time, in milliseconds<\/li>\n<li><code>NX<\/code>: only set the key if it does not already exist<\/li>\n<li><code>XX<\/code>: only set the key if it already exist<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming <code>mykey<\/code> doesn\u2019t exist, the command sets its value to \u201c<strong>value<\/strong>\u201d.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/setbit\">http:\/\/redis.io\/commands\/setbit<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 37<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SETBIT key offset value<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Sets or clears the bit at offset in the string value stored at key. If value is not 0 or 1, command returns an error <code>ERR bit is not an integer or out of range<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming <code>mykey<\/code> exists and has value \u201c<strong>value<\/strong>\u201d, the command sets the bit at offset 2 to 1.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/setbit\">http:\/\/redis.io\/commands\/setbit<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 38<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SETEX key seconds value <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Set the value and expiration of a key. The variation of <code>SET key value EX seconds<\/code> command.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>SET<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/setex\">http:\/\/redis.io\/commands\/setex<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 39<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SETNX key value <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Sets the value of a key, only if the key does not exist. The variation of <code>SET key value NX<\/code> command.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>SET<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/setnx\">http:\/\/redis.io\/commands\/setnx<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 40<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SETRANGE key offset value <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Overwrites part of a string at key starting at the specified offset. If key doesn\u2019t exist, its value will be filled with 0 up to the offset.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming <code>mykey<\/code> exists and has value \u201c<strong>value<\/strong>\u201d, the command replaces last three characters with \u201ceul\u201d resulting into final value \u201cvaeul\u201d.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/setrange\">http:\/\/redis.io\/commands\/setrange<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 41<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>STRLEN key <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets the length of the value stored in a key. If key doesn\u2019t exist, command returns 0.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming <code>mykey<\/code> exists and has value \u201c<strong>value<\/strong>\u201d, the command returns its value length (<strong>5<\/strong>).<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/strlen\">http:\/\/redis.io\/commands\/strlen<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 42<\/p>\n<\/div>\n<h2><a name=\"hashes\"><\/a>4. Hashes<\/h2>\n<p>We may think about hashes as an analogy to the traditional object notation: it\u2019s a container of fields (or properties) and their values. All commands which expect value of the key to be hash start with \u2018<strong>H<\/strong>\u2018 (<code>HGET<\/code>, <code>HSET<\/code>, \u2026). If key doesn\u2019t hold a hash value, all <code>Hxxx<\/code> commands return an error <code>WRONGTYPE Operation against a key holding the wrong kind of value<\/code>.<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>HDEL key field [field &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Deletes one or more hash fields. Command returns how many fields have been deleted.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and has field <code>field1<\/code>, the command deletes this field from the key.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/hdel\">http:\/\/redis.io\/commands\/hdel<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 43<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>HEXISTS key field <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Determines if a hash field exists. Command returns 1 if field exists and 0 otherwise.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and has field <code>field1<\/code>, the command confirms that by returning <strong>1<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/hexists\">http:\/\/redis.io\/commands\/hexists<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 44<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>HGET key field<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets the value of a hash field. Command returns <code>(nil)<\/code> if field doesn\u2019t exist.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and has field <code>field1<\/code> with value \u201c<strong>value<\/strong>\u201d, the command returns string \u201c<strong>value<\/strong>\u201d.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 45<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>HGETALL key <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets all the fields and values in a hash. Command returns every field name, followed by its value.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and has the fields <code>field1<\/code>, <code>field2<\/code>, the command returns their names and values.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/hgetall\">http:\/\/redis.io\/commands\/hgetall<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 46<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>HINCRBY key field increment <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Increments the integer value of a hash field by the given number.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>DECR<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/hincrby\">http:\/\/redis.io\/commands\/hincrby<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 47<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>HINCRBYFLOAT key field increment <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Increments the float value of a hash field by the given amount.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>DECR<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/hincrbyfloat\">http:\/\/redis.io\/commands\/hincrbyfloat<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 48<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>HKEYS key<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets all the fields in a hash. It\u2019s very similar to <code>HGETALL<\/code> except this command returns only field names (without values).<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>HGETALL<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/hkeys\">http:\/\/redis.io\/commands\/hkeys<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 49<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>HLEN key<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets the number of fields in a hash.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and has the fields <code>field1<\/code>, <code>field2<\/code>, the command returns total number of fields <strong>(2)<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/hlen\">http:\/\/redis.io\/commands\/hlen<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 50<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>HMGET key field [field &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets the values of all the given hash fields.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and has the fields <code>field1<\/code>, <code>field2<\/code>, <code>field2<\/code>, the command returns only values of fields <code>field1<\/code>, <code>field2<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/hmget\">http:\/\/redis.io\/commands\/hmget<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 51<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>HMSET key field value [field value &#8230;]<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Sets multiple hash fields to multiple values. If some fields already exist for the given key, they will be overridden.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> doesn\u2019t exist, the command sets its fields <code>field1<\/code> to \u201c<strong>value1<\/strong>\u201d and <code>field2<\/code> to \u201c<strong>value2<\/strong>\u201d.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/hset\">http:\/\/redis.io\/commands\/hset<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 52<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>HSET key field value<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Sets the string value of a hash field.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>HMSET<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/hset\">http:\/\/redis.io\/commands\/hset<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 53<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>HSETNX key field value<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Sets the value of a hash field, only if the field does not exist.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>HSET<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/hset\">http:\/\/redis.io\/commands\/hset<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 54<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>HVALS key <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets all the values in a hash.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and has fields <code>field1<\/code>, <code>field2<\/code> with values \u201c<strong>value1<\/strong>\u201d, \u201c<strong>value2<\/strong>\u201d, the command returns only fields\u2019 values.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/hvals\">http:\/\/redis.io\/commands\/hvals<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 55<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>HSCAN key cursor [MATCH pattern] [COUNT count] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Incrementally iterates hash fields and associated values.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>SCAN<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/hscan\">http:\/\/redis.io\/commands\/hscan<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 56<\/p>\n<\/div>\n<h2><a name=\"lists\"><\/a>5. Lists<\/h2>\n<p>Lists are the most widely used data type to represent the general-purpose collections. It\u2019s very easy to understand and manipulate. Some list operations have blocking and non-blocking forms. If a given key doesn\u2019t hold a list value, all list-related commands return an error <code>WRONGTYPE Operation against a key holding the wrong kind of value<\/code>.<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>BLPOP key [key &#8230;] timeout <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Removes and get the first element in a list, or block until one is available. Please notice that <code>timeout<\/code> should be specified in seconds.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a list of values \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value1<\/strong>\u201d the command returns the first element from the list.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/blpop\">http:\/\/redis.io\/commands\/blpop<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 57<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>BRPOP key [key &#8230;] timeout<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Removes and gets the last element in the list or block until one is available. Please notice that <code>timeout<\/code> should be specified in seconds.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>BLPOP<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/brpop\">http:\/\/redis.io\/commands\/brpop<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 58<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>BRPOPLPUSH source destination timeout <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Pops a value from a list, pushes it to another list and return it; or blocks until one is available. Please notice that <code>timeout<\/code> should be specified in seconds.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a list of values \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value1<\/strong>\u201d the command pops \u201c<strong>value1<\/strong>\u201d from it and pushes it to the list behind <code>mykey1<\/code> key.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/brpoplpush\">http:\/\/redis.io\/commands\/brpoplpush<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 59<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>LINDEX key index <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets an element from a list by its index. Please notice that index starts from <strong>0<\/strong>. If index goes over the length of the list, command returns <code>(nil)<\/code> as a value.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a list of values \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value1<\/strong>\u201d the command returns the \u201c<strong>value2<\/strong>\u201d as a first element of the list.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/lindex\">http:\/\/redis.io\/commands\/lindex<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 60<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>LINSERT key BEFORE|AFTER pivot value <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Inserts an element before or after another element in a list. The command returns a total number of elements in the list after inserting the values.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a list of values \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value1<\/strong>\u201d the command inserts a value \u201c<strong>value3<\/strong>\u201d after \u201c<strong>value2<\/strong>\u201d.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/linsert\">http:\/\/redis.io\/commands\/linsert<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 61<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>LLEN key <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets the length of a list.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a list of values \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value1<\/strong>\u201d the command returns total number of elements in the list <strong>(2)<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/llen\">http:\/\/redis.io\/commands\/llen<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 62<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>LPOP key <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Removes and gets the first element in a list. Please notice if the list is empty, command returns <code>(nil)<\/code> as a value.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a list of values \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value1<\/strong>\u201d the command pops the first element \u201c<strong>value2<\/strong>\u201d from the list.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/lpop\">http:\/\/redis.io\/commands\/lpop<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 63<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>LPUSH key value [value &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Prepends one or multiple values to a list. The command returns the total number of elements in the list after prepending the values. If the given key doesn\u2019t exist, it will be created.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> doesn\u2019t exist the command creates it as list holder and puts \u201c<strong>value1<\/strong>\u201d, \u201c<strong>value2<\/strong>\u201d to it. Because it\u2019s prepending operation, the actual order of the elements in the list will be \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value1<\/strong>\u201d.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/lpush\">http:\/\/redis.io\/commands\/lpush<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 64<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>LPUSHX key value <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Prepends a value to a list, only if the list exists.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>LPUSH<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/lpushx%1F\">http:\/\/redis.io\/commands\/lpushx<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 65<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>LRANGE key start stop <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets a range of elements from a list.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a list of values \u201c<strong>value3<\/strong>\u201d, \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value1<\/strong>\u201d the command returns elements \u201c<strong>value3<\/strong>\u201d, \u201c<strong>value2<\/strong>\u201d as a sub-list.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/lrange\">http:\/\/redis.io\/commands\/lrange<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 66<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>LREM key count value <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Removes elements from a list. The command returns the total number of elements removed. The count argument influences the operation in the following ways:<\/p>\n<ul>\n<li><strong>count &gt; 0<\/strong>: removes elements equal to value moving from head to tail<\/li>\n<li><strong>count &lt; 0<\/strong>: removes elements equal to value moving from tail to head<\/li>\n<li><strong>count = 0<\/strong>: removes all elements equal to value<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a list of values \u201c<strong>value3<\/strong>\u201d, \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value1<\/strong>\u201d the command removes element \u201c<strong>value2<\/strong>\u201d from the list.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/lrem\">http:\/\/redis.io\/commands\/lrem<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 67<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>LSET key index value <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Sets the value of an element in a list by its index.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a list of values \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value1<\/strong>\u201d the command sets the element at index 0 (first element) to \u201c<strong>value3<\/strong>\u201d (effectively, replaces \u201c<strong>value2<\/strong>\u201d with \u201c<strong>value3<\/strong>\u201d).<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/lset\">http:\/\/redis.io\/commands\/lset<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 68<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>LTRIM key start stop<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Trims a list to the specified range.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a list of values \u201c<strong>value3<\/strong>\u201d, \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value1<\/strong>\u201d the command trims the list to <strong>2<\/strong> elements (to hold only values \u201c<strong>value3<\/strong>\u201d, \u201c<strong>value2<\/strong>\u201d).<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/ltrim\">http:\/\/redis.io\/commands\/ltrim<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 69<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>RPOP key <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Removes and gets the last element in a list.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>LPOP<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/rpop\">http:\/\/redis.io\/commands\/rpop<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 70<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>RPOPLPUSH source destination<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Removes the last elements in a list, append it to another list and return it.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>BRPOPLPUSH<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/rpoplpush\">http:\/\/redis.io\/commands\/rpoplpush<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 71<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>RPUSH key value [value &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Appends one or multiple values to a list. The command returns total elements in the list after appending the values.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>LPUSH<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/rpush\">http:\/\/redis.io\/commands\/rpush<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 72<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>RPUSHX key value <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Appends a value to a list, only if the list exists.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>LPUSH<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/rpushx\">http:\/\/redis.io\/commands\/rpushx<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 73<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SORT key [BY pattern] [LIMIT offset count] [GET pattern [GET pattern &#8230;]] [ASC|DESC] [ALPHA] [STORE destination]<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Sorts the elements in a list, set or sorted set.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>This is an extremely powerful command with rich set of options. In its simplest use, assuming the key <code>mykey<\/code> exists and holds a list of values \u201c<strong>value3<\/strong>\u201d, \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value1<\/strong>\u201d the command sorts elements alphabetically and returns sorted list (\u201c<strong>value1<\/strong>\u201d, \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value3<\/strong>\u201d).<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/sort\">http:\/\/redis.io\/commands\/sort<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 74<\/p>\n<\/div>\n<h2><a name=\"sets\"><\/a>6. Sets<\/h2>\n<p>Sets are a data structure very similar to lists except sets don\u2019t allow duplicate elements. As such, couple of specific operations has more sense over sets: unions, intersections, and substractions. All commands which expect value of the key to be a set start with \u2018<strong>S<\/strong>\u2018 (<code>SADD<\/code>, <code>SDIFF<\/code>, \u2026). If a given key doesn\u2019t hold a set value, all set-related commands return an error <code>WRONGTYPE Operation against a key holding the wrong kind of value<\/code>.<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SADD key member [member &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Adds one or more members to a set. The command returns number of elements added to a set.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> doesn\u2019t exist, the command creates it as a set holder and puts member <strong>1<\/strong> to it.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/sadd\">http:\/\/redis.io\/commands\/sadd<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 75<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SCARD key <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets the number of members in a set.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a set of members <strong>1, 2, 3<\/strong> the command returns total number of members in the set <strong>(3)<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/scard\">http:\/\/redis.io\/commands\/scard<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 76<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SDIFF key [key &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Subtracts multiple sets. The command returns the members of the set resulting from the difference between the first set and all the successive sets.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a set of members <strong>1, 2, 3<\/strong> and <code>mykey1<\/code> exists and holds a set of members <strong>2, 3, 4<\/strong> the command returns <strong>1<\/strong> (the only member which is not present in <code>mykey1<\/code>).<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/sdiff\">http:\/\/redis.io\/commands\/sdiff<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 77<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SDIFFSTORE destination key [key &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Subtracts multiple sets and store the resulting set in a key.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>SDIFF<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/sdiffstore\">http:\/\/redis.io\/commands\/sdiffstore<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 78<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SINTER key [key &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Intersects multiple sets.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a set of members <strong>1, 2, 3<\/strong> and <code>mykey1<\/code> exists and holds a set of members <strong>2, 3, 4<\/strong> the command returns <strong>2, 3<\/strong> (members present in <code>mykey<\/code> and <code>mykey1<\/code>).<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/sinter\">http:\/\/redis.io\/commands\/sinter<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 79<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SINTERSTORE destination key [key &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Intersects multiple sets and stores the resulting set in a key.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>SINTER<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/sinterstore\">http:\/\/redis.io\/commands\/sinterstore<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 80<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SISMEMBER key member <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Determines if a given value is a member of a set.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a set of members <strong>1, 2, 3<\/strong>, the command returns <strong>1<\/strong> (exists) for member <strong>2<\/strong> and <strong>0<\/strong> (doesn\u2019t exist) for member <strong>5<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/sismember\">http:\/\/redis.io\/commands\/sismember<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 81<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SMEMBERS key <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets all the members in a set.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a set of members <strong>1, 2, 3<\/strong>, the command returns those members.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/smembers\">http:\/\/redis.io\/commands\/smembers<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 82<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SMOVE source destination member <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Moves a member from one set to another. The command returns <strong>1<\/strong> if member has been moved and 0 otherwise.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a set of members <strong>1, 2, 3<\/strong>, the command moves <strong>1<\/strong> to another set, backed by the key <code>mykey1<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/smove\">http:\/\/redis.io\/commands\/smove<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 83<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SPOP key<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Removes and returns a random member from a set.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>LPOP<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/spop\">http:\/\/redis.io\/commands\/spop<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 84<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SRANDMEMBER key [count] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets one or multiple random members from a set.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a set of members <strong>1, 2, 3<\/strong>, the command returns randomly members <strong>1, 3<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/srandmember\">http:\/\/redis.io\/commands\/srandmember<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 85<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SREM key member [member &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Removes one or more members from a set.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>LREM<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/srem\">http:\/\/redis.io\/commands\/srem<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 86<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SUNION key [key &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Adds multiple sets.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a set of members <strong>1, 2, 3<\/strong> and <code>mykey1<\/code> exists and holds a set of members <strong>2, 3, 4<\/strong> the command returns <strong>1, 2, 3, 4<\/strong> (all members from <code>mykey<\/code> and <code>mykey1<\/code>).<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/sunion\">http:\/\/redis.io\/commands\/sunion<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 87<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SUNIONSTORE destination key [key &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Adds multiple sets and stores the resulting set in a key.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>SUNION<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/sunionstore\">http:\/\/redis.io\/commands\/sunionstore<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 88<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SSCAN key cursor [MATCH pattern] [COUNT count] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Incrementally iterates set elements.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>SCAN<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/sscan\">http:\/\/redis.io\/commands\/sscan<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 89<\/p>\n<\/div>\n<h2><a name=\"sorted_sets\"><\/a>7. Sorted Sets<\/h2>\n<p>The difference between sets and sorted sets is that sorted sets store not only members but their scores as well (and score defines sorting order for members in the sorted set). All commands which expect value of the key to be a sorted set start with \u2018<strong>Z<\/strong>\u2018 (<code>ZADD<\/code>, <code>ZCARD<\/code> , \u2026). If a given key doesn\u2019t hold a sorted set value, all sorted sets-related commands return an error <code>WRONGTYPE Operation against a key holding the wrong kind of value<\/code>.<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>ZADD key score member [score member &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Adds one or more members to a sorted set, or updates its score if it already exists. The command returns number of elements added to a set.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> doesn\u2019t exist, the command creates it as a sorted set holder and puts member <strong>value1<\/strong> with score <strong>1<\/strong> to it.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/zadd\">http:\/\/redis.io\/commands\/zadd<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 90<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>ZCARD key <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets the number of members in a sorted set.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>SCARD<\/code>command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/zcard\">http:\/\/redis.io\/commands\/zcard<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 91<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>ZCOUNT key min max <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Counts the members in a sorted set with scores within the given values.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a set of members \u201c<strong>value1<\/strong>\u201d, \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value3<\/strong>\u201d with scores <strong>1, 5, 10<\/strong> respectively, the command returns number of members <strong>(1)<\/strong> with a score between <strong>4<\/strong> and <strong>6<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/zcount\">http:\/\/redis.io\/commands\/zcount<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 92<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>ZINCRBY key increment member <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Increments the score of a member in a sorted set. The command returns new score of the member.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a set of members \u201c<strong>value1<\/strong>\u201d, \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value3<\/strong>\u201d with scores<br \/>\n<strong>1, 5, 10<\/strong> respectively, the command increments score of member \u201c<strong>value2<\/strong>\u201d by <strong>5<\/strong> and returns its new score <strong>(10)<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/zincrby\">http:\/\/redis.io\/commands\/zincrby<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 93<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>ZINTERSTORE destination numkeys key [key &#8230;] [WEIGHTS weight [weight &#8230;]] [AGGREGATE SUM|MIN|MAX] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Intersects multiple sorted sets and stores the resulting sorted set in a new key.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>SINTER<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/zinterstore\">http:\/\/redis.io\/commands\/zinterstore<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 94<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>ZRANGE key start stop [WITHSCORES] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Returns a range of members in a sorted set, by index. The index starts from 0.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a set of members \u201c<strong>value1<\/strong>\u201d, \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value3<\/strong>\u201d with scores<br \/>\n<strong>1, 5, 10<\/strong> respectively, the command returns first two members (with indexes <strong>0<\/strong> and <strong>1<\/strong>).<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/zrange\">http:\/\/redis.io\/commands\/zrange<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 95<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Returns a range of members in a sorted set, by score.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a set of members \u201c<strong>value1<\/strong>\u201d, \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value3<\/strong>\u201d with scores<br \/>\n<strong>1, 5, 10<\/strong> respectively, the command returns member \u201c<strong>value2<\/strong>\u201d as the one with a score between <strong>4<\/strong> and <strong>6<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/zrangebyscore\">http:\/\/redis.io\/commands\/zrangebyscore<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 96<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>ZRANK key member <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Determines the index of a member in a sorted set. Please notice that indexing starts with 0.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a set of members \u201c<strong>value1<\/strong>\u201d, \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value3<\/strong>\u201d with scores<br \/>\n<strong>1, 5, 10<\/strong> respectively, the command returns <strong>1<\/strong> as an index for member \u201c<strong>value2<\/strong>\u201d.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/zrank\">http:\/\/redis.io\/commands\/zrank<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 97<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>ZREM key member [member &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Removes one or more members from a sorted set.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>SREM<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/zrem\">http:\/\/redis.io\/commands\/zrem<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 98<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>ZREMRANGEBYRANK key start stop<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Removes all members in a sorted set within the given indexes. The indexing starts from 0. The command returns number of successfully removed members.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a set of members \u201c<strong>value1<\/strong>\u201d, \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value3<\/strong>\u201d with scores<br \/>\n<strong>1, 5, 10<\/strong> respectively, the command returns <strong>(2)<\/strong> and removes first two members (with indexes <strong>0<\/strong> and <strong>1<\/strong>).<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/zremrangebyrank\">http:\/\/redis.io\/commands\/zremrangebyrank<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 99<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>ZREMRANGEBYSCORE key min max <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Removes all members in a sorted set within the given scores. The command returns number of successfully removed members.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a set of members \u201c<strong>value1<\/strong>\u201d, \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value3<\/strong>\u201d with scores<br \/>\n<strong>1, 5, 10<\/strong> respectively, the command returns <strong>(1)<\/strong> and removes member \u201c<strong>value2<\/strong>\u201d (with a score between <strong>4<\/strong> and <strong>6<\/strong>).<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/zremrangebyscore\">http:\/\/redis.io\/commands\/zremrangebyscore<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 100<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>ZREVRANGE key start stop [WITHSCORES] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Returns a range of members in a sorted set, by index, with scores ordered from high to low.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>ZRANGE<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/zrevrank\">http:\/\/redis.io\/commands\/zrevrank<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 101<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>ZREVRANGEBYSCORE key max min [WITHSCORES] [LIMIT offset count] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Returns a range of members in a sorted set, by score, with scores ordered from high to low.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>ZRANGEBYSCORE<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/zrevrangebyscore\">http:\/\/redis.io\/commands\/zrevrangebyscore<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 102<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>ZREVRANK key member <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Determines the index of a member in a sorted set, with scores ordered from high to low.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>ZRANK<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/zrevrank\">http:\/\/redis.io\/commands\/zrevrank<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 103<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>ZSCORE key member <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets the score associated with the given member in a sorted set.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Assuming the key <code>mykey<\/code> exists and holds a set of members \u201c<strong>value1<\/strong>\u201d, \u201c<strong>value2<\/strong>\u201d, \u201c<strong>value3<\/strong>\u201d with scores<br \/>\n<strong>1, 5, 10<\/strong> respectively, the command returns <strong>(5)<\/strong> as a score for a member \u201c<strong>value2<\/strong>\u201d.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/zscore\">http:\/\/redis.io\/commands\/zscore<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 104<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>ZUNIONSTORE destination numkeys key [key &#8230;] [WEIGHTS weight [weight &#8230;]] [AGGREGATE SUM|MIN|MAX]<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Adds multiple sorted sets and stores the resulting sorted set in a new key.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>SUNION<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/zunionstore\">http:\/\/redis.io\/commands\/zunionstore<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 105<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>ZSCAN key cursor [MATCH pattern] [COUNT count] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Incrementally iterates sorted sets elements and associated scores.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>SCAN<\/code> command<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/zscan\">http:\/\/redis.io\/commands\/zscan<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 106<\/p>\n<\/div>\n<h2><a name=\"publish_subscribe\"><\/a>8. Publish \/ Subscribe<\/h2>\n<p>Redis supports out-of-box publish \/ subscribe messaging style using its powerful data structures as a queue. If you need very simple, fast and easy to use pub\/sub messaging solution, Redis is definitely a candidate to consider. For this section we need two running instances of <code>redis-cli<\/code>, one will be <code>publisher<\/code> (producer) and another will be <code>subscriber<\/code> (consumer).<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>PSUBSCRIBE pattern [pattern &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Listens for messages published to channels matching the given patterns.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>The following example subscribes the client to listen for any messages from all channels.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/psubscribe\">http:\/\/redis.io\/commands\/psubscribe<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 107<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>PUBSUB subcommand [argument [argument &#8230;]] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Inspects the state of the Pub\/Sub subsystem. It is an introspection command and is composed of subcommands that are documented separately.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>The following example inspects current active channels.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/pubsub\">http:\/\/redis.io\/commands\/pubsub<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 108<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>PUBLISH channel message<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Posts a message to a channel.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>The following example publishes a message to channel <code>mychannel<\/code>.<br \/>\nAnd subscriber (see <code>PSUBSCRIBE<\/code> command) receives it.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/publish\">http:\/\/redis.io\/commands\/publish<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 109<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>PUNSUBSCRIBE [pattern [pattern &#8230;]] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Stops listening for messages posted to channels matching the given. Patterns<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/punsubscribe\">http:\/\/redis.io\/commands\/punsubscribe<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 110<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SUBSCRIBE channel [channel &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Listens for messages published to the given channels.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>See <code>PSUBSCRIBE<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/subscribe\">http:\/\/redis.io\/commands\/subscribe<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 111<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>UNSUBSCRIBE [channel [channel &#8230;]] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Stops listening for messages posted to the given channels.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/unsubscribe\">http:\/\/redis.io\/commands\/unsubscribe<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 112<\/p>\n<\/div>\n<h2><a name=\"transactions\"><\/a>9. Transactions<\/h2>\n<p>Redis supports the powerful notion of transactions. It\u2019s not exactly the same as we used to (for example, when dealing with relational databases) but still very useful feature. The way transactions work in Redis could be described by this flow:<\/p>\n<ul>\n<li><code>WATCH<\/code> is used to provide a check-and-set (CAS) behavior to transactions: watched keys are monitored in order to detect changes against them. If at least one watched key is modified before the <code>EXEC<\/code> command, the whole transaction aborts and fails.<\/li>\n<li><code>MULTI<\/code> starts the transaction<\/li>\n<li>At this point the user can issue multiple commands which will be queued<\/li>\n<li><code>EXEC<\/code> executes all commands<\/li>\n<li><code>DISCARD<\/code> aborts the transaction<\/li>\n<\/ul>\n<p>Very important to notice that Redis commands can fail during a transaction, but still Redis will execute the rest of the transaction instead of rolling back. For more comprehensive details please refer to <a href=\"http:\/\/redis.io\/topics\/transactions\">http:\/\/redis.io\/topics\/transactions<\/a>.<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>DISCARD <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Discards all commands issued after MULTI.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/discard\">http:\/\/redis.io\/commands\/discard<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 113<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>EXEC<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Executes all commands issued after MULTI.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/exec\">http:\/\/redis.io\/commands\/exec<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 114<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>MULTI<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Marks the start of a transaction block.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/multi\">http:\/\/redis.io\/commands\/multi<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 115<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>UNWATCH<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Forgets about all watched keys.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/unwatch\">http:\/\/redis.io\/commands\/unwatch<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 116<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>WATCH key [key &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Watches the given keys to determine execution of the MULTI\/EXEC block.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/watch\">http:\/\/redis.io\/commands\/watch<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 117<\/p>\n<\/div>\n<h2><a name=\"scripting\"><\/a>10. Scripting<\/h2>\n<p>Redis support server-side scripting using <code>Lua<\/code> programming language (<a href=\"http:\/\/www.lua.org\/\">http:\/\/www.lua.org\/<\/a>). This section just goes through the set of commands related to scripts manipulation. It\u2019s quite a large topic worth a whole tutorial.<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>EVAL script numkeys key [key &#8230;] arg [arg &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Executes a Lua script server side.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/eval\">http:\/\/redis.io\/commands\/eval<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 118<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>EVALSHA sha1 numkeys key [key &#8230;] arg [arg &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Executes a Lua script server side.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/evalsha\">http:\/\/redis.io\/commands\/evalsha<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 119<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SCRIPT EXISTS script [script &#8230;] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Checks existence of scripts in the script cache.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/script-exists\">http:\/\/redis.io\/commands\/script-exists<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 120<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SCRIPT FLUSH<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Removes all the scripts from the script cache.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/script-flush\">http:\/\/redis.io\/commands\/script-flush<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 121<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SCRIPT KILL<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Kills the script currently in execution.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/script-kill\">http:\/\/redis.io\/commands\/script-kill<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 122<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SCRIPT LOAD script <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Loads the specified Lua script into the script cache.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/script-load\">http:\/\/redis.io\/commands\/script-load<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 123<\/p>\n<\/div>\n<h2><a name=\"connection\"><\/a>11. Connection<\/h2>\n<p>This small set of command allows to manage some connection (session) specific parameters like authentication and database to work on.<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>AUTH password <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Authenticates to the server.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/auth\">http:\/\/redis.io\/commands\/auth<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 124<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>ECHO message <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Echoes the given string.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/echo\">http:\/\/redis.io\/commands\/echo<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 125<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>PING<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Pings the server. On success, command returns <code>PONG<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/ping\">http:\/\/redis.io\/commands\/ping<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 126<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>QUIT<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Closes the connection.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/quit\">http:\/\/redis.io\/commands\/quit<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 127<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SELECT index<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Changes the selected database for the current connection.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/select\">http:\/\/redis.io\/commands\/select<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 128<\/p>\n<\/div>\n<h2><a name=\"server\"><\/a>12. Server<\/h2>\n<p>This class of commands is related to Redis server internals and manages persistence, replication, configuration and connections. Some commands will be used later on in following parts of the tutorial.<\/p>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>BGREWRITEAOF<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Asynchronously rewrites the append-only file.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/bgrewriteaof\">http:\/\/redis.io\/commands\/bgrewriteaof<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 129<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>BGSAVE<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Asynchronously saves the dataset to disk.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/bgsave\">http:\/\/redis.io\/commands\/bgsave<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 130<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>CLIENT KILL ip:port <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Kills the connection of a client. The <code>IP address<\/code> and <code>port<\/code> could be obtained from <code>CLIENT LIST<\/code> command.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/client-kill\">http:\/\/redis.io\/commands\/client-kill<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 131<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>CLIENT LIST <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets the list of client connections.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>Example of command\u2019s result for 2 connected clients (the output is clipped a bit).<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/client-list\"><strong>http:\/\/redis.io\/commands\/client-list<\/strong><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 132<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>CLIENT GETNAME <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets the current connection name.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>The command returns the name of current connection, <code>myconn<\/code> (previously set by <code>CLIENT SETNAME<\/code> command).<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/client-getname\">http:\/\/redis.io\/commands\/client-getname<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 133<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>CLIENT SETNAME connection-name <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Sets the current connection name.<\/td>\n<\/tr>\n<tr>\n<td><strong>Example<\/strong><\/td>\n<td>The command sets the name of current connection to <code><strong>myconn<\/strong><\/code>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/client-setname\">http:\/\/redis.io\/commands\/client-setname<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 134<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>CONFIG GET parameter<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets the value of a configuration parameter.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/config-get\">http:\/\/redis.io\/commands\/config-get<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 135<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>CONFIG REWRITE <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Rewrites the configuration file with the in memory configuration.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/config-rewrite\">http:\/\/redis.io\/commands\/config-rewrite<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 136<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>CONFIG SET parameter value <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Sets a configuration parameter to the given value.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/config-set\">http:\/\/redis.io\/commands\/config-set<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 137<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>CONFIG RESETSTAT <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Resets the stats returned by INFO.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/config-resetstat\">http:\/\/redis.io\/commands\/config-resetstat<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 138<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>DBSIZE<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Returns the number of keys in the selected database.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/dbsize\">http:\/\/redis.io\/commands\/dbsize<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 139<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>DEBUG OBJECT key <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets debugging information about a key. This command includes the results of <code>OBJECT<\/code> command.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/debug-object\">http:\/\/redis.io\/commands\/debug-object<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 140<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>DEBUG SEGFAULT <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Makes the server crash.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/debug-segfault\">http:\/\/redis.io\/commands\/debug-segfault<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 141<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>FLUSHALL<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Removes all keys from all databases.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/flushall\">http:\/\/redis.io\/commands\/flushall<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 142<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>FLUSHDB<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Removes all keys from the current database.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/flushdb\">http:\/\/redis.io\/commands\/flushdb<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 143<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>INFO [section] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets information and statistics about the server.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/info\">http:\/\/redis.io\/commands\/info<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 144<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>LASTSAVE<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Gets the UNIX time stamp of the last successful save to disk.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/lastsave\">http:\/\/redis.io\/commands\/lastsave<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 145<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>MONITOR<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Listens for all requests received by the server in real time.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/monitor\">http:\/\/redis.io\/commands\/monitor<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 146<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SAVE<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Synchronously saves the dataset to disk<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/save\">http:\/\/redis.io\/commands\/save<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 147<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SHUTDOWN [NOSAVE] [SAVE] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Synchronously saves the dataset to disk and then shuts down the server.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/shutdown\">http:\/\/redis.io\/commands\/shutdown<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 148<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SLAVEOF host port <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Makes the server a slave of another instance, or promotes it as master. We will see this command in action later on in the tutorial.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/slaveof\">http:\/\/redis.io\/commands\/slaveof<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 149<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SLOWLOG subcommand [argument] <\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Manages the Redis slow queries log.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/slowlog\">http:\/\/redis.io\/commands\/slowlog<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 150<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>SYNC<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Internal command used for replication.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/sync\">http:\/\/redis.io\/commands\/sync<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 151<\/p>\n<\/div>\n<div class=\"wp-caption aligncenter\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>TIME<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Description<\/strong><\/td>\n<td>Return the current server time.<\/td>\n<\/tr>\n<tr>\n<td><strong>Reference<\/strong><\/td>\n<td><a href=\"http:\/\/redis.io\/commands\/time\">http:\/\/redis.io\/commands\/time<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"wp-caption-text\">Table 152<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This article is part of our Academy Course titled Redis a NoSQL key-value store. This is a crash course on Redis. You will learn how to install Redis and start up the server. Additionally, you will mess around with the Redis command line. More advanced topics follow, such as replication, sharding and clustering, while the &hellip;<\/p>\n","protected":false},"author":141,"featured_media":223,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[113,117],"class_list":["post-43939","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-nosql","tag-redis"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Redis Commands \u2013 Using Redis Command Line - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"This article is part of our Academy Course titled Redis a NoSQL key-value store. This is a crash course on Redis. You will learn how to install Redis and\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2015\/09\/redis-commands-using-redis-command-line.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Redis Commands \u2013 Using Redis Command Line - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"This article is part of our Academy Course titled Redis a NoSQL key-value store. This is a crash course on Redis. You will learn how to install Redis and\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2015\/09\/redis-commands-using-redis-command-line.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2015-09-21T11:17:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-06T12:51:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/redis-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Andrey Redko\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andrey Redko\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"28 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/redis-commands-using-redis-command-line.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/redis-commands-using-redis-command-line.html\"},\"author\":{\"name\":\"Andrey Redko\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/771a6504862edc45322776832cbce413\"},\"headline\":\"Redis Commands \u2013 Using Redis Command Line\",\"datePublished\":\"2015-09-21T11:17:57+00:00\",\"dateModified\":\"2023-12-06T12:51:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/redis-commands-using-redis-command-line.html\"},\"wordCount\":6630,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/redis-commands-using-redis-command-line.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/redis-logo.jpg\",\"keywords\":[\"NoSQL\",\"Redis\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/redis-commands-using-redis-command-line.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/redis-commands-using-redis-command-line.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/redis-commands-using-redis-command-line.html\",\"name\":\"Redis Commands \u2013 Using Redis Command Line - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/redis-commands-using-redis-command-line.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/redis-commands-using-redis-command-line.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/redis-logo.jpg\",\"datePublished\":\"2015-09-21T11:17:57+00:00\",\"dateModified\":\"2023-12-06T12:51:11+00:00\",\"description\":\"This article is part of our Academy Course titled Redis a NoSQL key-value store. This is a crash course on Redis. You will learn how to install Redis and\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/redis-commands-using-redis-command-line.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/redis-commands-using-redis-command-line.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/redis-commands-using-redis-command-line.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/redis-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/redis-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/redis-commands-using-redis-command-line.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Redis Commands \u2013 Using Redis Command Line\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/771a6504862edc45322776832cbce413\",\"name\":\"Andrey Redko\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/16419ce8394173028eddaeb992859862bab50cfcf74589fa9bb9a3dd8bb27518?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/16419ce8394173028eddaeb992859862bab50cfcf74589fa9bb9a3dd8bb27518?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/16419ce8394173028eddaeb992859862bab50cfcf74589fa9bb9a3dd8bb27518?s=96&d=mm&r=g\",\"caption\":\"Andrey Redko\"},\"description\":\"Andriy is a well-grounded software developer with more then 12 years of practical experience using Java\\\/EE, C#\\\/.NET, C++, Groovy, Ruby, functional programming (Scala), databases (MySQL, PostgreSQL, Oracle) and NoSQL solutions (MongoDB, Redis).\",\"sameAs\":[\"http:\\\/\\\/aredko.blogspot.com\\\/\",\"http:\\\/\\\/ca.linkedin.com\\\/in\\\/aredko\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/andrey-redko\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Redis Commands \u2013 Using Redis Command Line - Java Code Geeks","description":"This article is part of our Academy Course titled Redis a NoSQL key-value store. This is a crash course on Redis. You will learn how to install Redis and","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2015\/09\/redis-commands-using-redis-command-line.html","og_locale":"en_US","og_type":"article","og_title":"Redis Commands \u2013 Using Redis Command Line - Java Code Geeks","og_description":"This article is part of our Academy Course titled Redis a NoSQL key-value store. This is a crash course on Redis. You will learn how to install Redis and","og_url":"https:\/\/www.javacodegeeks.com\/2015\/09\/redis-commands-using-redis-command-line.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2015-09-21T11:17:57+00:00","article_modified_time":"2023-12-06T12:51:11+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/redis-logo.jpg","type":"image\/jpeg"}],"author":"Andrey Redko","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Andrey Redko","Est. reading time":"28 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/redis-commands-using-redis-command-line.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/redis-commands-using-redis-command-line.html"},"author":{"name":"Andrey Redko","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/771a6504862edc45322776832cbce413"},"headline":"Redis Commands \u2013 Using Redis Command Line","datePublished":"2015-09-21T11:17:57+00:00","dateModified":"2023-12-06T12:51:11+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/redis-commands-using-redis-command-line.html"},"wordCount":6630,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/redis-commands-using-redis-command-line.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/redis-logo.jpg","keywords":["NoSQL","Redis"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2015\/09\/redis-commands-using-redis-command-line.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/redis-commands-using-redis-command-line.html","url":"https:\/\/www.javacodegeeks.com\/2015\/09\/redis-commands-using-redis-command-line.html","name":"Redis Commands \u2013 Using Redis Command Line - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/redis-commands-using-redis-command-line.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/redis-commands-using-redis-command-line.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/redis-logo.jpg","datePublished":"2015-09-21T11:17:57+00:00","dateModified":"2023-12-06T12:51:11+00:00","description":"This article is part of our Academy Course titled Redis a NoSQL key-value store. This is a crash course on Redis. You will learn how to install Redis and","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/redis-commands-using-redis-command-line.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2015\/09\/redis-commands-using-redis-command-line.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/redis-commands-using-redis-command-line.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/redis-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/redis-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/redis-commands-using-redis-command-line.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Redis Commands \u2013 Using Redis Command Line"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/771a6504862edc45322776832cbce413","name":"Andrey Redko","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/16419ce8394173028eddaeb992859862bab50cfcf74589fa9bb9a3dd8bb27518?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/16419ce8394173028eddaeb992859862bab50cfcf74589fa9bb9a3dd8bb27518?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/16419ce8394173028eddaeb992859862bab50cfcf74589fa9bb9a3dd8bb27518?s=96&d=mm&r=g","caption":"Andrey Redko"},"description":"Andriy is a well-grounded software developer with more then 12 years of practical experience using Java\/EE, C#\/.NET, C++, Groovy, Ruby, functional programming (Scala), databases (MySQL, PostgreSQL, Oracle) and NoSQL solutions (MongoDB, Redis).","sameAs":["http:\/\/aredko.blogspot.com\/","http:\/\/ca.linkedin.com\/in\/aredko"],"url":"https:\/\/www.javacodegeeks.com\/author\/andrey-redko"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/43939","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/141"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=43939"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/43939\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/223"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=43939"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=43939"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=43939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}