2.redis-help使用,基本命令


redis 幫助

127.0.0.1:6379> help
redis-cli 3.0.4
Type: "help @<group>" to get a list of commands in <group>
      "help <command>" for help on <command>
      "help <tab>" to get a list of possible help topics
      "quit" to exit
127.0.0.1:6379> help APPEND(help 具體命令)

  APPEND key value
  summary: Append a value to a key
  since: 2.0.0
  group: string

 127.0.0.1:6379> help @generic(help @tab鍵)

 

常用命令

 

string

127.0.0.1:6379> help set

  SET key value [EX seconds] [PX milliseconds] [NX|XX]
  summary: Set the string value of a key
  since: 1.0.0
  group: string

 

set

127.0.0.1:6379> set disto fedora
OK
127.0.0.1:6379> get disto
"fedora"
127.0.0.1:6379> APPEND disto slackware
(integer) 15
127.0.0.1:6379> get disto
"fedoraslackware"
127.0.0.1:6379> STRLEN disto
(integer) 15
127.0.0.1:6379> set count 0
OK
127.0.0.1:6379> INCR count (比如微博被轉載的次數,每次加1)
(integer) 1
127.0.0.1:6379> INCR count
(integer) 2
127.0.0.1:6379> INCR count
(integer) 3
127.0.0.1:6379> DECR count(每次減1)
(integer) 2
127.0.0.1:6379> DECR count
(integer) 1

127.0.0.1:6379> help SETEX

 
         

SETEX key seconds value //設置建的過期時間
summary: Set the value and expiration of a key
since: 2.0.0
group: string

127.0.0.1:6379> help SETNX

SETNX key value //當鍵不存在時,設置值
summary: Set the value of a key, only if the key does not exist
since: 1.0.0
group: string




 

get

exists

 


免責聲明!

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



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