redis演练 最全redis命令列表

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了redis演练 最全redis命令列表相关的知识,希望对你有一定的参考价值。

官方The full list of commands

官方在线交互学习工具

Redis命令参考简体中文版

Redis-cli命令最新总结

Redis 命令参考(官方中文翻译)

Redis命令简明示例


下面列表是本人通过程序搜集的help命令整理的聚合列表,希望为redis填把火。

COMMANDsummarysincegroup
DECR key Decrement the integer value of a  key by one 1.0.0 string
DECRBY key decrement Decrement the integer value of a  key by the given number 1.0.0 string
DEL key [key ...] Delete a key 1.0.0 generic
EXISTS key [key ...] Determine if a key exists 1.0.0 generic
EXPIRE key seconds Set a key‘s time to live in  seconds 1.0.0 generic
GET key Get the value of a key 1.0.0 string
GETSET key value Set the string value of a key and  return its old value 1.0.0 string
HDEL key field [field ...] Delete one or more hash fields 2.0.0 hash
HEXISTS key field Determine if a hash field exists 2.0.0 hash
HGET key field Get the value of a hash field 2.0.0 hash
HGETALL key Get all the fields and values in a  hash 2.0.0 hash
HINCRBY key field increment Increment the integer value of a  hash field by the given number 2.0.0 hash
HKEYS key Get all the fields in a hash 2.0.0 hash
HLEN key Get the number of fields in a hash 2.0.0 hash
HMGET key field [field ...] Get the values of all the given  hash fields 2.0.0 hash
HMSET key field value [field value ...] Set multiple hash fields to  multiple values 2.0.0 hash
HSET key field value Set the string value of a hash  field 2.0.0 hash
HVALS key Get all the values in a hash 2.0.0 hash
INCR key Increment the integer value of a  key by one 1.0.0 string
INCRBY key increment Increment the integer value of a  key by the given amount 1.0.0 string
KEYS pattern Find all keys matching the given  pattern 1.0.0 generic
LINDEX key index Get an element from a list by its  index 1.0.0 list
LLEN key Get the length of a list 1.0.0 list
LPOP key Remove and get the first element  in a list 1.0.0 list
LPUSH key value [value ...] Prepend one or multiple values to  a list 1.0.0 list
LRANGE key start stop Get a range of elements from a  list 1.0.0 list
LREM key count value Remove elements from a list 1.0.0 list
LSET key index value Set the value of an element in a  list by its index 1.0.0 list
LTRIM key start stop Trim a list to the specified range 1.0.0 list
MGET key [key ...] Get the values of all the given  keys 1.0.0 string
MSET key value [key value ...] Set multiple keys to multiple  values 1.0.1 string
MSETNX key value [key value ...] Set multiple keys to multiple  values, only if none of the keys exist 1.0.1 string
MULTI Mark the start of a transaction  block 1.2.0 transactions
PEXPIRE key milliseconds Set a key‘s time to live in  milliseconds 2.6.0 generic
RENAME key newkey Rename a key 1.0.0 generic
RENAMENX key newkey Rename a key, only if the new key  does not exist 1.0.0 generic
RPOP key Remove and get the last element in  a list 1.0.0 list
RPOPLPUSH source destination Remove the last element in a list,  prepend it to another list and return it 1.2.0 list
RPUSH key value [value ...] Append one or multiple values to a  list 1.0.0 list
SADD key member [member ...] Add one or more members to a set 1.0.0 set
SCARD key Get the number of members in a set 1.0.0 set
SDIFF key [key ...] Subtract multiple sets 1.0.0 set
SDIFFSTORE destination key [key ...] Subtract multiple sets and store  the resulting set in a key 1.0.0 set
SET key value [EX seconds] [PX  milliseconds] [NX|XX] Set the string value of a key 1.0.0 string
SETEX key seconds value Set the value and expiration of a  key 2.0.0 string
SETNX key value Set the value of a key, only if  the key does not exist 1.0.0 string
SINTER key [key ...] Intersect multiple sets 1.0.0 set
SINTERSTORE destination key [key ...] Intersect multiple sets and store  the resulting set in a key 1.0.0 set
SISMEMBER key member Determine if a given value is a  member of a set 1.0.0 set
SMEMBERS key Get all the members in a set 1.0.0 set
SMOVE source destination member Move a member from one set to  another 1.0.0 set
SORT 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 generic
SPOP key [count] Remove and return one or multiple  random members from a set 1.0.0 set
SRANDMEMBER key [count] Get one or multiple random members  from a set 1.0.0 set
SREM key member [member ...] Remove one or more members from a  set 1.0.0 set
SUNION key [key ...] Add multiple sets 1.0.0 set
SUNIONSTORE destination key [key ...] Add multiple sets and store the  resulting set in a key 1.0.0 set
TTL key Get the time to live for a key 1.0.0 generic
TYPE key Determine the type stored at key 1.0.0 generic
ZADD 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_set
ZCARD key Get the number of members in a  sorted set 1.2.0 sorted_set
ZCOUNT key min max Count the members in a sorted set  with scores within the given values 2.0.0 sorted_set
ZINCRBY key increment member Increment the score of a member in  a sorted set 1.2.0 sorted_set
ZRANGE key start stop [WITHSCORES] Return a range of members in a  sorted set, by index 1.2.0 sorted_set
ZRANGEBYSCORE key min max [WITHSCORES]  [LIMIT offset count] Return a range of members in a  sorted set, by score 1.0.5 sorted_set
ZRANK key member Determine the index of a member in  a sorted set 2.0.0 sorted_set
ZREM key member [member ...] Remove one or more members from a  sorted set 1.2.0 sorted_set
ZREMRANGEBYSCORE key min max Remove all members in a sorted set  within the given scores 1.2.0 sorted_set
ZREVRANGE 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_set
ZSCORE key member Get the score associated with the  given member in a sorted set 1.2.0 sorted_set


每个命令不复杂,难点就是命令太多,但还需要自己花时间一行行的敲,一个个的实验。


本文出自 “简单” 博客,请务必保留此出处http://dba10g.blog.51cto.com/764602/1843602

以上是关于redis演练 最全redis命令列表的主要内容,如果未能解决你的问题,请参考以下文章

最全面的Redis命令行查阅手册(收藏查看)

redis演练(10) redis Cluster 集群节点维护

redis演练 redis Sentinel实现故障转移

《吐血整理》Redis 性能优化的 13 条军规!史上最全

《吐血整理》Redis 性能优化的 13 条军规!史上最全

redis演练 搭建redis服务