官方The full list of commands
官方在线交互学习工具
Redis命令参考简体中文版
Redis-cli命令最新总结
Redis 命令参考(官方中文翻译)
Redis命令简明示例
下面列表是本人通过程序搜集的help命令整理的聚合列表,希望为redis填把火。
COMMANDsummarysincegroupDEL key [key ...] Delete a key 1.0.0 genericEXISTS key [key ...] Determine if a key exists 1.0.0 genericEXPIRE key seconds Set a key's time to live in seconds 1.0.0 genericKEYS pattern Find all keys matching the given pattern 1.0.0 genericPEXPIRE key milliseconds Set a key's time to live in milliseconds 2.6.0 genericRENAME key newkey Rename a key 1.0.0 genericRENAMENX key newkey Rename a key, only if the new key does not exist 1.0.0 genericSORT key [BY pattern] [LIMIT offset count] [GET pattern [GET pattern ...]] [ASC|DESC] [ALPHA] [STORE tination] Sort the elements in a list, set or sorted set 1.0.0 genericTTL key Get the time to live for a key 1.0.0 genericTYPE key Determine the type stored at key 1.0.0 genericHDEL key field [field ...] Delete one or more hash fields 2.0.0 hashHEXISTS key field Determine if a hash field exists 2.0.0 hashHGET key field Get the value of a hash field 2.0.0 hashHGETALL key Get all the fields and values in a hash 2.0.0 hashHINCRBY key field increment Increment the integer value of a hash field by the given number 2.0.0 hashHKEYS key Get all the fields in a hash 2.0.0 hashHLEN key Get the number of fields in a hash 2.0.0 hashHMGET key field [field ...] Get the values of all the given hash fields 2.0.0 hashHMSET key field value [field value ...] Set multiple hash fields to multiple values 2.0.0 hashHSET key field value Set the string value of a hash field 2.0.0 hashHVALS key Get all the values in a hash 2.0.0 hashLINDEX key index Get an element from a list by its index 1.0.0 listLLEN key Get the length of a list 1.0.0 listLPOP key Remove and get the first element in a list 1.0.0 listLPUSH key value [value ...] Prepend one or multiple values to a list 1.0.0 listLRANGE key start stop Get a range of elements from a list 1.0.0 listLREM key count value Remove elements from a list 1.0.0 listLSET key index value Set the value of an element in a list by its index 1.0.0 listLTRIM key start stop Trim a list to the specified range 1.0.0 listRPOP key Remove and get the last element in a list 1.0.0 listRPOPLPUSH source destination Remove the last element in a list, prepend it to another list and return it 1.2.0 listRPUSH key value [value ...] Append one or multiple values to a list 1.0.0 listSADD key member [member ...] Add one or more members to a set 1.0.0 setSCARD key Get the number of members in a set 1.0.0 setSDIFF key [key ...] Subtract multiple sets 1.0.0 setSDIFFSTORE destination key [key ...] Subtract multiple sets and store the resulting set in a key 1.0.0 setSINTER key [key ...] Intersect multiple sets 1.0.0 setSINTERSTORE destination key [key ...] Intersect multiple sets and store the resulting set in a key 1.0.0 setSISMEMBER key member Determine if a given value is a member of a set 1.0.0 setSMEMBERS key Get all the members in a set 1.0.0 setSMOVE source destination member Move a member from one set to another 1.0.0 setSPOP key [count] Remove and return one or multiple random members from a set 1.0.0 setSRANDMEMBER key [count] Get one or multiple random members from a set 1.0.0 setSREM key member [member ...] Remove one or more members from a set 1.0.0 setSUNION key [key ...] Add multiple sets 1.0.0 setSUNIONSTORE destination key [key ...] Add multiple sets and store the resulting set in a key 1.0.0 setZADD key [NX|XX] [CH] [INCR] score member [score member ...] Add one or more members to a sorted set, or update its score if it already exists 1.2.0 sorted_setZCARD key Get the number of members in a sorted set 1.2.0 sorted_setZCOUNT key min max Count the members in a sorted set with scores within the given values 2.0.0 sorted_setZINCRBY key increment member Increment the score of a member in a sorted set 1.2.0 sorted_setZRANGE key start stop [WITHSCORES] Return a range of members in a sorted set, by index 1.2.0 sorted_setZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count] Return a range of members in a sorted set, by score 1.0.5 sorted_setZRANK key member Determine the index of a member in a sorted set 2.0.0 sorted_setZREM key member [member ...] Remove one or more members from a sorted set 1.2.0 sorted_setZREMRANGEBYSCORE key min max Remove all members in a sorted set within the given scores 1.2.0 sorted_setZREVRANGE key start stop [WITHSCORES] Return a range of members in a sorted set, by index, with scores ordered from high to low 1.2.0 sorted_setZSCORE key member Get the score associated with the given member in a sorted set 1.2.0 sorted_setDECR key Decrement the integer value of a key by one 1.0.0 stringDECRBY key decrement Decrement the integer value of a key by the given number 1.0.0 stringGET key Get the value of a key 1.0.0 stringGETSET key value Set the string value of a key and return its old value 1.0.0 stringINCR key Increment the integer value of a key by one 1.0.0 stringINCRBY key increment Increment the integer value of a key by the given amount 1.0.0 stringMGET key [key ...] Get the values of all the given keys 1.0.0 stringMSET key value [key value ...] Set multiple keys to multiple values 1.0.1 stringMSETNX key value [key value ...] Set multiple keys to multiple values, only if none of the keys exist 1.0.1 stringSET key value [EX seconds] [PX milliseconds] [NX|XX] Set the string value of a key 1.0.0 stringSETEX key seconds value Set the value and expiration of a key 2.0.0 stringSETNX key value Set the value of a key, only if the key does not exist 1.0.0 stringMULTI Mark the start of a transaction block 1.2.0 transactions 每个命令不复杂,难点就是命令太多,但还需要自己花时间一行行的敲,一个个的实验。