官方The full list of commands
官方在线交互学习工具
Redis命令参考简体中文版
Redis-cli命令最新总结
Redis 命令参考(官方中文翻译)
Redis命令简明示例
下面列表是本人通过程序搜集的help命令整理的聚合列表,希望为redis填把火。
COMMANDsummarysincegroupDEL key [key ...]Delete a key1.0.0genericEXISTS key [key ...]Determine if a key exists1.0.0genericEXPIRE key secondsSet a key's time to live in seconds1.0.0genericKEYS patternFind all keys matching the given pattern1.0.0genericPEXPIRE key millisecondsSet a key's time to live in milliseconds2.6.0genericRENAME key newkeyRename a key1.0.0genericRENAMENX key newkeyRename a key, only if the new key does not exist1.0.0genericSORT key [BY pattern] [LIMIT offset count] [GET pattern [GET pattern ...]] [ASC|DESC] [ALPHA] [STORE tination]Sort the elements in a list, set or sorted set1.0.0genericTTL keyGet the time to live for a key1.0.0genericTYPE keyDetermine the type stored at key1.0.0genericHDEL key field [field ...]Delete one or more hash fields2.0.0hashHEXISTS key fieldDetermine if a hash field exists2.0.0hashHGET key fieldGet the value of a hash field2.0.0hashHGETALL keyGet all the fields and values in a hash2.0.0hashHINCRBY key field incrementIncrement the integer value of a hash field by the given number2.0.0hashHKEYS keyGet all the fields in a hash2.0.0hashHLEN keyGet the number of fields in a hash2.0.0hashHMGET key field [field ...]Get the values of all the given hash fields2.0.0hashHMSET key field value [field value ...]Set multiple hash fields to multiple values2.0.0hashHSET key field valueSet the string value of a hash field2.0.0hashHVALS keyGet all the values in a hash2.0.0hashLINDEX key indexGet an element from a list by its index1.0.0listLLEN keyGet the length of a list1.0.0listLPOP keyRemove and get the first element in a list1.0.0listLPUSH key value [value ...]Prepend one or multiple values to a list1.0.0listLRANGE key start stopGet a range of elements from a list1.0.0listLREM key count valueRemove elements from a list1.0.0listLSET key index valueSet the value of an element in a list by its index1.0.0listLTRIM key start stopTrim a list to the specified range1.0.0listRPOP keyRemove and get the last element in a list1.0.0listRPOPLPUSH source destinationRemove the last element in a list, prepend it to another list and return it1.2.0listRPUSH key value [value ...]Append one or multiple values to a list1.0.0listSADD key member [member ...]Add one or more members to a set1.0.0setSCARD keyGet the number of members in a set1.0.0setSDIFF key [key ...]Subtract multiple sets1.0.0setSDIFFSTORE destination key [key ...]Subtract multiple sets and store the resulting set in a key1.0.0setSINTER key [key ...]Intersect multiple sets1.0.0setSINTERSTORE destination key [key ...]Intersect multiple sets and store the resulting set in a key1.0.0setSISMEMBER key memberDetermine if a given value is a member of a set1.0.0setSMEMBERS keyGet all the members in a set1.0.0setSMOVE source destination memberMove a member from one set to another1.0.0setSPOP key [count]Remove and return one or multiple random members from a set1.0.0setSRANDMEMBER key [count]Get one or multiple random members from a set1.0.0setSREM key member [member ...]Remove one or more members from a set1.0.0setSUNION key [key ...]Add multiple sets1.0.0setSUNIONSTORE destination key [key ...]Add multiple sets and store the resulting set in a key1.0.0setZADD 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 exists1.2.0sorted_setZCARD keyGet the number of members in a sorted set1.2.0sorted_setZCOUNT key min maxCount the members in a sorted set with scores within the given values2.0.0sorted_setZINCRBY key increment memberIncrement the score of a member in a sorted set1.2.0sorted_setZRANGE key start stop [WITHSCORES]Return a range of members in a sorted set, by index1.2.0sorted_setZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]Return a range of members in a sorted set, by score1.0.5sorted_setZRANK key memberDetermine the index of a member in a sorted set2.0.0sorted_setZREM key member [member ...]Remove one or more members from a sorted set1.2.0sorted_setZREMRANGEBYSCORE key min maxRemove all members in a sorted set within the given scores1.2.0sorted_setZREVRANGE key start stop [WITHSCORES]Return a range of members in a sorted set, by index, with scores ordered from high to low1.2.0sorted_setZSCORE key memberGet the score associated with the given member in a sorted set1.2.0sorted_setDECR keyDecrement the integer value of a key by one1.0.0stringDECRBY key decrementDecrement the integer value of a key by the given number1.0.0stringGET keyGet the value of a key1.0.0stringGETSET key valueSet the string value of a key and return its old value1.0.0stringINCR keyIncrement the integer value of a key by one1.0.0stringINCRBY key incrementIncrement the integer value of a key by the given amount1.0.0stringMGET key [key ...]Get the values of all the given keys1.0.0stringMSET key value [key value ...]Set multiple keys to multiple values1.0.1stringMSETNX key value [key value ...]Set multiple keys to multiple values, only if none of the keys exist1.0.1stringSET key value [EX seconds] [PX milliseconds] [NX|XX]Set the string value of a key1.0.0stringSETEX key seconds valueSet the value and expiration of a key2.0.0stringSETNX key valueSet the value of a key, only if the key does not exist1.0.0stringMULTIMark the start of a transaction block1.2.0transactions
每个命令不复杂,难点就是命令太多,但还需要自己花时间一行行的敲,一个个的实验。