redis 帮助

127.0.0.1:> help
redis-cli 3.0.
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:> help APPEND(help 具体命令) APPEND key value
summary: Append a value to a key
since: 2.0.
group: string

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

 

常用命令

string

127.0.0.1:> help set

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

set

127.0.0.1:> set disto fedora
OK
127.0.0.1:> get disto
"fedora"
127.0.0.1:> APPEND disto slackware
(integer)
127.0.0.1:> get disto
"fedoraslackware"
127.0.0.1:> STRLEN disto
(integer)
127.0.0.1:> set count
OK
127.0.0.1:> INCR count (比如微博被转载的次数,每次加1)
(integer)
127.0.0.1:> INCR count
(integer)
127.0.0.1:> INCR count
(integer)
127.0.0.1:> DECR count(每次减1)
(integer)
127.0.0.1:> DECR count
(integer)

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

05-23 09:49