Posted On: Jan 09, 2021
Some operation keys of Redis are listed bellow:
Command | Description |
---|---|
APPEND key value | Append a value to a key |
AUTH password | Authenticate to the server |
BGREWRITEAOF | Asynchronously rewrite the append-only file |
BITPOS key bit [start] [end] | Find the first-bit set or clear in a string |
BLPOP key [key ...] timeout | Remove and get the first element in a list, or block until one is available |
CLIENT LIST | Get the list of client connections |
CLIENT PAUSE timeout | Stop processing commands from clients for some time |
CLUSTER FORGET node-id | Remove a node from the nodes table |
CLUSTER INFO | Provides info about Redis Cluster node state |
CLUSTER KEYSLOT key | Returns the hash slot of the specified key |
CLUSTER MEET ip port | Force a node cluster to handshake with another node |
CLUSTER NODES | Get Cluster config for the node |
CLUSTER SAVECONFIG | Forces the node to save cluster state on disk |
CLUSTER SLAVES node-id | List slave nodes of the specified master node |
CLUSTER SLOTS | Get an array of Cluster slot to node mappings |
COMMAND | Get an array of Redis command details |
COMMAND COUNT | Get the total number of Redis commands |
COMMAND GETKEYS | Extract keys are given a full Redis command |
CONFIG GET parameter | Get the value of a configuration parameter |
CONFIG REWRITE | Rewrite the configuration file with the in-memory configuration |
CONFIG SET parameter value | Set a configuration parameter to the given value |
CONFIG RESETSTAT | Reset the stats returned by INFO |
DBSIZE | Return the number of keys in the selected database |
DEBUG OBJECT key | Get debugging information about a key |
DEBUG SEGFAULT | Make the server crash |
DECR key | Decrement the integer value of a key by one |
DECRBY key decrement | Decrement the integer value of a key by the given number |
DEL key [key ...] | Delete a key |
DISCARD | Discard all commands issued after MULTI |
DUMP key | Return a serialized version of the value stored at the specified key. |
ECHO message | Echo the given string |
EXEC | Execute all commands issued after MULTI |
EXPIRE key seconds | Set a key's time to live in seconds |
GET key | Get the value of a key |
GETBIT key offset | Returns the bit value at offset in the string value stored at key |
GETRANGE key start end | Get a substring of the string stored at a key |
GETSET key value | Set the string value of a key and return its old value |
HDEL key field [field ...] | Delete one or more hash fields |
HEXISTS key field | Determine if a hash field exists |
HGET key field | Get the value of a hash field |
HGETALL key | Get all the fields and values in a hash |
HKEYS key | Get all the fields in a hash |
HLEN key | Get the number of fields in a hash |
HSET key field value | Set the string value of a hash field |
HSETNX key field value | Set the value of a hash field, only if the field does not exist |
HSTRLEN key field | Get the length of the value of a hash field |
HVALS key | Get all the values in a hash |
INCR key | Increment the integer value of a key by one |
INCRBY key increment | Increment the integer value of a key by the given amount |
INFO [section] | Get information and statistics about the server |
KEYS pattern | Find all keys matching the given pattern |
LASTSAVE | Get the UNIX timestamp of the last successful save to a disk |
LINDEX key index | Get an element from a list by its index |
LLEN key | Get the length of a list |
LPOP key | Remove and get the first element in a list |
LPUSHX key value | Prepend a value to a list, only if the list exists |
LRANGE key start stop | Get a range of elements from a list |
LREM key count value | Remove elements from a list |
LSET key index value | Set the value of an element in a list by its index |
LTRIM key start stop | Trim a list to the specified range |
MGET key [key ...] | Get the values of all the given keys |
MONITOR | Listen for all requests received by the server in real-time |
MOVE key db | Move a key to another database |
MULTI | Mark the start of a transaction block |
PERSIST key | Remove the expiration from a key |
PFCOUNT key [key ...] | Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s). |
PING [message] | Ping the server |
PTTL key | Get the time to live for a key in milliseconds |
QUIT | Close the connection |
RANDOMKEY | Return a random key from the keyspace |
READONLY | Enables read queries for a connection to a cluster slave node |
READWRITE | Disables read queries for a connection to a cluster slave node |
RENAME key newkey | Rename a key |
ROLE | Return the role of the instance in the context of replication |
RPOP key | Remove and get the last element in a list |
RPUSHX key value | Append a value to a list, only if the list exists |
SAVE | Synchronously save the dataset to disk |
SCARD key | Get the number of members in a set |
SCRIPT FLUSH | Remove all the scripts from the script cache. |
SCRIPT KILL | Kill the script currently in execution. |
SCRIPT LOAD script | Load the specified Lua script into the script cache. |
SDIFF key [key ...] | Subtract multiple sets |
SELECT index | Change the selected database for the current connection |
SETNX key value | Set the value of a key, only if the key does not exist |
SINTER key [key ...] | Intersect multiple sets |
SLAVEOF host port | Make the server a slave of another instance, or promote it as master |
SMEMBERS key | Get all the members in a set |
SPOP key [count] | Remove and return one or multiple random members from a set |
STRLEN key | Get the length of the value stored in a key |
SWAPDB index index | Swaps two Redis databases |
SYNC | An internal command used for replication |
TIME | Return the current server time |
TOUCH key [key ...] | Alters the last access time of a key(s). Returns the number of existing keys specified. |
TTL key | Get the time to live for a key |
TYPE key | Determine the type stored at key |
UNLINK key [key ...] | Delete a key asynchronously in another thread. Otherwise, it is just as DEL, but non-blocking. |
UNWATCH | Forget about all watched keys |
Never Miss an Articles from us.
Redis is an open source released under BSD licensed, in-memory data structure store, it can be used as a database, cach..
Redis supports following Data Structures Strings Hashes Lists Sets Sorted sets with range queries bitmaps Hyperloglogs ..
Following are some advantages of Redis Exceptionally Faster than othersSupports for rich data types like Hashes, Set..