redis 命令都在這了


  1. DEL key [key ...]刪除指定的key(一個或多個)
  2. DUMP key導出key的值
  3. EXISTS key [key ...]查詢一個key是否存在
  4. EXPIRE key seconds設置一個key的過期的秒數
  5. EXPIREAT key timestamp設置一個UNIX時間戳的過期時間
  6. KEYS pattern查找所有匹配給定的模式的鍵
  7. MIGRATE host port key destination-db timeout [COPY] [REPLACE]原子性的將key從redis的一個實例移到另一個實例
  8. MOVE key db移動一個key到另一個數據庫
  9. OBJECT subcommand [arguments [arguments ...]]檢查內部的再分配對象
  10. PERSIST key移除key的過期時間
  11. PEXPIRE key milliseconds設置key的有效時間以毫秒為單位
  12. PEXPIREAT key milliseconds-timestamp設置key的到期UNIX時間戳以毫秒為單位
  13. PTTL key獲取key的有效毫秒數
  14. RANDOMKEY 返回一個隨機的key
  15. RENAME key newkey將一個key重命名
  16. RENAMENX key newkey重命名一個key,新的key必須是不存在的key
  17. RESTORE key ttl serialized-value [REPLACE]Create a key using the provided serialized value, previously obtained using DUMP.
  18. SORT key [BY pattern] [LIMIT offset count] [GET pattern [GET pattern ...]] [ASC|DESC] [ALPHA] [STORE destination]對隊列、集合、有序集合排序
  19. TTL key獲取key的有效時間(單位:秒)
  20. TYPE key獲取key的存儲類型
  21. WAIT numslaves timeoutWait for the synchronous replication of all the write commands sent in the context of the current connection
  22. SCAN cursor [MATCH pattern] [COUNT count]增量迭代key
  23. APPEND key value追加一個值到key上
  24. BITCOUNT key [start end]統計字符串指定起始位置的字節數
  25. BITFIELD key [GET type offset] [SET type offset value] [INCRBY type offset increment] [OVERFLOW WRAP|SAT|FAIL]Perform arbitrary bitfield integer operations on strings
  26. BITOP operation destkey key [key ...]Perform bitwise operations between strings
  27. BITPOS key bit [start] [end]Find first bit set or clear in a string
  28. DECR key整數原子減1
  29. DECRBY key decrement原子減指定的整數
  30. GET key返回key的value
  31. GETBIT key offset返回位的值存儲在關鍵的字符串值的偏移量。
  32. GETRANGE key start end獲取存儲在key上的值的一個子字符串
  33. GETSET key value設置一個key的value,並獲取設置前的值
  34. INCR key執行原子加1操作
  35. INCRBY key increment執行原子增加一個整數
  36. INCRBYFLOAT key increment執行原子增加一個浮點數
  37. MGET key [key ...]獲得所有key的值
  38. MSET key value [key value ...]設置多個key value
  39. MSETNX key value [key value ...]設置多個key value,僅當key存在時
  40. PSETEX key milliseconds valueSet the value and expiration in milliseconds of a key
  41. SET key value [EX seconds] [PX milliseconds] [NX|XX]設置一個key的value值
  42. SETBIT key offset valueSets or clears the bit at offset in the string value stored at key
  43. SETEX key seconds value設置key-value並設置過期時間(單位:秒)
  44. SETNX key value設置的一個關鍵的價值,只有當該鍵不存在
  45. SETRANGE key offset valueOverwrite part of a string at key starting at the specified offset
  46. STRLEN key獲取指定key值的長度
  47. BLPOP key [key ...] timeout刪除,並獲得該列表中的第一元素,或阻塞,直到有一個可用
  48. BRPOP key [key ...] timeout刪除,並獲得該列表中的最后一個元素,或阻塞,直到有一個可用
  49. BRPOPLPUSH source destination timeout彈出一個列表的值,將它推到另一個列表,並返回它;或阻塞,直到有一個可用
  50. LINDEX key index獲取一個元素,通過其索引列表
  51. LINSERT key BEFORE|AFTER pivot value在列表中的另一個元素之前或之后插入一個元素
  52. LLEN key獲得隊列(List)的長度
  53. LPOP key從隊列的左邊出隊一個元素
  54. LPUSH key value [value ...]從隊列的左邊入隊一個或多個元素
  55. LPUSHX key value當隊列存在時,從隊到左邊入隊一個元素
  56. LRANGE key start stop從列表中獲取指定返回的元素
  57. LREM key count value從列表中刪除元素
  58. LSET key index value設置隊列里面一個元素的值
  59. LTRIM key start stop修剪到指定范圍內的清單
  60. RPOP key從隊列的右邊出隊一個元
  61. RPOPLPUSH source destination刪除列表中的最后一個元素,將其追加到另一個列表
  62. RPUSH key value [value ...]從隊列的右邊入隊一個元素
  63. RPUSHX key value從隊列的右邊入隊一個元素,僅隊列存在時有效
  64. PSUBSCRIBE pattern [pattern ...]Listen for messages published to channels matching the given patterns
  65. PUBSUB subcommand [argument [argument ...]]Inspect the state of the Pub/Sub subsystem
  66. PUBLISH channel message發布一條消息到頻道
  67. PUNSUBSCRIBE [pattern [pattern ...]]停止發布到匹配給定模式的渠道的消息聽
  68. SUBSCRIBE channel [channel ...]監聽頻道發布的消息
  69. UNSUBSCRIBE [channel [channel ...]]停止頻道監聽
  70. EVAL script numkeys key [key ...] arg [arg ...]在服務器端執行 LUA 腳本
  71. EVALSHA sha1 numkeys key [key ...] arg [arg ...]在服務器端執行 LUA 腳本
  72. SCRIPT DEBUG YES|SYNC|NOSet the debug mode for executed scripts.
  73. SCRIPT EXISTS script [script ...]Check existence of scripts in the script cache.
  74. SCRIPT FLUSH 刪除服務器緩存中所有Lua腳本。
  75. SCRIPT KILL 殺死當前正在運行的 Lua 腳本。
  76. SCRIPT LOAD script從服務器緩存中裝載一個Lua腳本。
  77. BGREWRITEAOF 異步重寫追加文件命令
  78. BGSAVE 異步保存數據集到磁盤上
  79. CLIENT KILL [ip:port] [ID client-id] [TYPE normal|slave|pubsub] [ADDR ip:port] [SKIPME yes/no]關閉客戶端連接
  80. CLIENT LIST 獲得客戶端連接列表
  81. CLIENT GETNAME 獲得當前連接名稱
  82. CLIENT ID Returns the client ID for the current connection
  83. CLIENT PAUSE timeout暫停處理客戶端命令
  84. CLIENT REPLY ON|OFF|SKIPInstruct the server whether to reply to commands
  85. CLIENT SETNAME connection-name設置當前連接的名字
  86. CLIENT UNBLOCK client-id [TIMEOUT|ERROR]Unblock a client blocked in a blocking command from a different connection
  87. COMMAND Get array of Redis command details
  88. COMMAND COUNT Get total number of Redis commands
  89. COMMAND GETKEYS Extract keys given a full Redis command
  90. COMMAND INFO command-name [command-name ...]Get array of specific Redis command details
  91. CONFIG GET parameter獲取配置參數的值
  92. CONFIG REWRITE 從寫內存中的配置文件
  93. CONFIG SET parameter value設置配置文件
  94. CONFIG RESETSTAT 復位再分配使用info命令報告的統計
  95. DBSIZE 返回當前數據庫里面的keys數量
  96. DEBUG OBJECT key獲取一個key的debug信息
  97. DEBUG SEGFAULT 使服務器崩潰命令
  98. FLUSHALL 清空所有數據庫命令
  99. FLUSHDB 清空當前的數據庫命令
  100. INFO [section]獲得服務器的詳細信息
  101. LASTSAVE 獲得最后一次同步磁盤的時間
  102. MEMORY DOCTOR Outputs memory problems report
  103. MEMORY HELP Show helpful text about the different subcommands
  104. MEMORY-MALLOC-STATS Show allocator internal stats
  105. MEMORY-PURGE Ask the allocator to release memory
  106. MEMORY-STATS Show memory usage details
  107. MEMORY-USAGE key [SAMPLES count]Estimate the memory usage of a key
  108. MONITOR 實時監控服務器
  109. REPLICAOF host portMake the server a replica of another instance, or promote it as master.
  110. ROLE Return the role of the instance in the context of replication
  111. SAVE 同步數據到磁盤上
  112. SHUTDOWN [NOSAVE] [SAVE]關閉服務
  113. SLAVEOF host port指定當前服務器的主服務器
  114. SLOWLOG subcommand [argument]管理再分配的慢查詢日志
  115. SYNC 用於復制的內部命令
  116. TIME 返回當前服務器時間
  117. SADD key member [member ...]添加一個或者多個元素到集合(set)里
  118. SCARD key獲取集合里面的元素數量
  119. SDIFF key [key ...]獲得隊列不存在的元素
  120. SDIFFSTORE destination key [key ...]獲得隊列不存在的元素,並存儲在一個關鍵的結果集
  121. SINTER key [key ...]獲得兩個集合的交集
  122. SINTERSTORE destination key [key ...]獲得兩個集合的交集,並存儲在一個關鍵的結果集
  123. SISMEMBER key member確定一個給定的值是一個集合的成員
  124. SMEMBERS key獲取集合里面的所有元素
  125. SMOVE source destination member移動集合里面的一個元素到另一個集合
  126. SPOP key [count]刪除並獲取一個集合里面的元素
  127. SRANDMEMBER key [count]從集合里面隨機獲取一個元素
  128. SREM key member [member ...]從集合里刪除一個或多個元素
  129. SUNION key [key ...]添加多個set元素
  130. SUNIONSTORE destination key [key ...]合並set元素,並將結果存入新的set里面
  131. SSCAN key cursor [MATCH pattern] [COUNT count]迭代set里面的元素
  132. ZADD key [NX|XX] [CH] [INCR] score member [score member ...]添加到有序set的一個或多個成員,或更新的分數,如果它已經存在
  133. ZCARD key獲取一個排序的集合中的成員數量
  134. ZCOUNT key min max返回分數范圍內的成員數量
  135. ZINCRBY key increment member增量的一名成員在排序設置的評分
  136. ZINTERSTORE destination numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM|MIN|MAX]相交多個排序集,導致排序的設置存儲在一個新的關鍵
  137. ZLEXCOUNT key min max返回成員之間的成員數量
  138. ZPOPMAX key [count]Remove and return members with the highest scores in a sorted set
  139. ZPOPMIN key [count]Remove and return members with the lowest scores in a sorted set
  140. ZRANGE key start stop [WITHSCORES]根據指定的index返回,返回sorted set的成員列表
  141. ZRANGEBYLEX key min max [LIMIT offset count]返回指定成員區間內的成員,按字典正序排列, 分數必須相同。
  142. ZREVRANGEBYLEX key max min [LIMIT offset count]返回指定成員區間內的成員,按字典倒序排列, 分數必須相同
  143. ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]返回有序集合中指定分數區間內的成員,分數由低到高排序。
  144. ZRANK key member確定在排序集合成員的索引
  145. ZREM key member [member ...]從排序的集合中刪除一個或多個成員
  146. ZREMRANGEBYLEX key min max刪除名稱按字典由低到高排序成員之間所有成員。
  147. ZREMRANGEBYRANK key start stop在排序設置的所有成員在給定的索引中刪除
  148. ZREMRANGEBYSCORE key min max刪除一個排序的設置在給定的分數所有成員
  149. ZREVRANGE key start stop [WITHSCORES]在排序的設置返回的成員范圍,通過索引,下令從分數高到低
  150. ZREVRANGEBYSCORE key max min [WITHSCORES] [LIMIT offset count]返回有序集合中指定分數區間內的成員,分數由高到低排序。
  151. ZREVRANK key member確定指數在排序集的成員,下令從分數高到低
  152. ZSCORE key member獲取成員在排序設置相關的比分
  153. ZUNIONSTORE destination numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM|MIN|MAX]添加多個排序集和導致排序的設置存儲在一個新的關鍵
  154. ZSCAN key cursor [MATCH pattern] [COUNT count]迭代sorted sets里面的元素
  155. XACK key group ID [ID ...]Marks a pending message as correctly processed, effectively removing it from the pending entries list of the consumer group. Return value of the command is the number of messages successfully acknowledged, that is, the IDs we were actually able to resolve in the PEL.
  156. XADD key ID field string [field string ...]Appends a new entry to a stream
  157. XCLAIM key group consumer min-idle-time ID [ID ...] [IDLE ms] [TIME ms-unix-time] [RETRYCOUNT count] [FORCE] [JUSTID]Changes (or acquires) ownership of a message in a consumer group, as if the message was delivered to the specified consumer.
  158. XDEL key ID [ID ...]Removes the specified entries from the stream. Returns the number of items actually deleted, that may be different from the number of IDs passed in case certain IDs do not exist.
  159. XGROUP [CREATE key groupname id-or-$] [SETID key id-or-$] [DESTROY key groupname] [DELCONSUMER key groupname consumername]Create, destroy, and manage consumer groups.
  160. XINFO [CONSUMERS key groupname] [GROUPS key] [STREAM key] [HELP]Get information on streams and consumer groups
  161. XLEN keyReturn the number of entires in a stream
  162. XPENDING key group [start end count] [consumer]Return information and entries from a stream consumer group pending entries list, that are messages fetched but never acknowledged.
  163. XRANGE key start end [COUNT count]Return a range of elements in a stream, with IDs matching the specified IDs interval
  164. XREAD [COUNT count] [BLOCK milliseconds] STREAMS key [key ...] ID [ID ...]Return never seen elements in multiple streams, with IDs greater than the ones reported by the caller for each stream. Can block.
  165. XREADGROUP GROUP group consumer [COUNT count] [BLOCK milliseconds] STREAMS key [key ...] ID [ID ...]Return new entries from a stream using a consumer group, or access the history of the pending entries for a given consumer. Can block.
  166. XREVRANGE key end start [COUNT count]Return a range of elements in a stream, with IDs matching the specified IDs interval, in reverse order (from greater to smaller IDs) compared to XRANGE
  167. XTRIM key MAXLEN [~] countTrims the stream to (approximately if '~' is passed) a certain size
  168. DISCARD 丟棄所有 MULTI 之后發的命令
  169. EXEC 執行所有 MULTI 之后發的命令
  170. MULTI 標記一個事務塊開始
  171. UNWATCH 取消事務命令
  172. WATCH key [key ...]鎖定key直到執行了 MULTI/EXEC 命令
  173. PFADD key element [element ...]將指定元素添加到HyperLogLog
  174. PFCOUNT key [key ...]Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).
  175. PFMERGE destkey sourcekey [sourcekey ...]Merge N different HyperLogLogs into a single one.
  176. HDEL key field [field ...]刪除一個或多個Hash的field
  177. HEXISTS key field判斷field是否存在於hash中
  178. HGET key field獲取hash中field的值
  179. HGETALL key從hash中讀取全部的域和值
  180. HINCRBY key field increment將hash中指定域的值增加給定的數字
  181. HINCRBYFLOAT key field increment將hash中指定域的值增加給定的浮點數
  182. HKEYS key獲取hash的所有字段
  183. HLEN key獲取hash里所有字段的數量
  184. HMGET key field [field ...]獲取hash里面指定字段的值
  185. HMSET key field value [field value ...]設置hash字段值
  186. HSET key field value設置hash里面一個字段的值
  187. HSETNX key field value設置hash的一個字段,只有當這個字段不存在時有效
  188. HSTRLEN key field獲取hash里面指定field的長度
  189. HVALS key獲得hash的所有值
  190. HSCAN key cursor [MATCH pattern] [COUNT count]迭代hash里面的元素
  191. GEOADD key longitude latitude member [longitude latitude member ...]添加一個或多個地理空間位置到sorted set
  192. GEOHASH key member [member ...]返回一個標准的地理空間的Geohash字符串
  193. GEOPOS key member [member ...]返回地理空間的經緯度
  194. GEODIST key member1 member2 [unit]返回兩個地理空間之間的距離
  195. GEORADIUS key longitude latitude radius m|km|ft|mi [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count]查詢指定半徑內所有的地理空間元素的集合。
  196. GEORADIUSBYMEMBER key member radius m|km|ft|mi [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count]查詢指定半徑內匹配到的最大距離的一個地理空間元素。
  197. AUTH password驗證服務器命令
  198. ECHO message回顯輸入的字符串
  199. PING Ping 服務器
  200. QUIT 關閉連接,退出
  201. SELECT index選擇新數據庫
  202. SWAPDB index indexSwaps two Redis databases
  203. CLUSTER ADDSLOTS slot [slot ...]Assign new hash slots to receiving node
  204. CLUSTER COUNT-FAILURE-REPORTS node-idReturn the number of failure reports active for a given node
  205. CLUSTER COUNTKEYSINSLOT slotReturn the number of local keys in the specified hash slot
  206. CLUSTER DELSLOTS slot [slot ...]Set hash slots as unbound in receiving node
  207. CLUSTER FAILOVER [FORCE|TAKEOVER]Forces a slave to perform a manual failover of its master.
  208. CLUSTER FORGET node-idRemove a node from the nodes table
  209. CLUSTER GETKEYSINSLOT slot countReturn local key names in the specified hash slot
  210. CLUSTER INFO Provides info about Redis Cluster node state
  211. CLUSTER KEYSLOT keyReturns the hash slot of the specified key
  212. CLUSTER MEET ip portForce a node cluster to handshake with another node
  213. CLUSTER NODES Get Cluster config for the node
  214. CLUSTER REPLICAS node-idList replica nodes of the specified master node
  215. CLUSTER REPLICATE node-idReconfigure a node as a slave of the specified master node
  216. CLUSTER RESET [HARD|SOFT]Reset a Redis Cluster node
  217. CLUSTER SAVECONFIG Forces the node to save cluster state on disk
  218. CLUSTER SET-CONFIG-EPOCH config-epochSet the configuration epoch in a new node
  219. CLUSTER SETSLOT slot IMPORTING|MIGRATING|STABLE|NODE [node-id]Bind an hash slot to a specific node
  220. CLUSTER SLAVES node-idList slave nodes of the specified master node
  221. CLUSTER SLOTS Get array of Cluster slot to node mappings
  222. READONLY Enables read queries for a connection to a cluster slave node
  223. READWRITE Disables read queries for a connection to a cluster slave node


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM