redis基本命令

redis基本命令

作者:LAMP小白  点击:2462  发布日期:2013-07-09 00:09:22  返回列表

玩耍命令

redis mio-org-u3:6379> ping

PONG

redis mio-org-u3:6379> echo 'test'

"test"


设置值

redis mio-org-u3:6379> set hoho haha

OK


查看键

redis mio-org-u3:6379> keys *

1) "hoho"

2) "haha"


判断值是否存在

redis mio-org-u3:6379> exists hoho

(integer) 1


删除

redis mio-org-u3:6379> del haha

(integer) 1


获取键值类型

redis mio-org-u3:6379> type hoho

string


获取值

redis mio-org-u3:6379> get hoho

"haha"


获取字符串长度

redis mio-org-u3:6379> strlen hoho

(integer) 4





上一篇:生产环境配置redis 下一篇:快递查询API
0