redis 基础 一:帮助文档的查看
博客地址:http://blog.lingang.me/2014/03/31/redis-jichu-1/
1、联上 redis-cli 之后输入 “?” 或者 “help”回车:
redis-cli 2.6.14Type: “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
输入 help @<group> 可以查到一组操作的使用,group 为操作的分组,比如 list 为一组操作,hash 为一组操作 server 为一组操作。比如输入 help @hash 能得到处理哈希类型的所有操作的解释以开始支持版本:
redis 127.0.0.1:6379> help @hash
HDEL key field [field ...]
summary: Delete one or more hash fields
since: 2.0.0
HEXISTS key field
summary: Determine if a hash field exists
since: 2.0.0
HGET key field
summary: Get the value of a hash field
since: 2.0.0
HGETALL key
summary: Get all the fields and values in a hash
since: 2.0.0
redis 127.0.0.1:6379> help lpop
LPOP key
summary: Remove and get the first element in a list
since: 1.0.0
group: list
redis 127.0.0.1:6379> help @generic
redis 127.0.0.1:6379> help @string
注意:此处以@符开头的能得到一组操作。
redis 127.0.0.1:6379> help LPOP
redis 127.0.0.1:6379> help LPUSH
好了,掌握了以上几种用法,已经足以你看遍所有 redis 命令了。