redis(二)

命令返回值

1、状态回复

  例如:PING    -->PONG

       SET  test  'this is a test'    -->OK

       GET  test    -->"this is a test"

 

2、错误回复

  我们在输入的时候,一不小心呢就会输错。

  例如:

 

3、整数回复

  所谓的整数回复是指:

  以integer数值

  比如:

 

4、字符串回复

  所谓的字符串回复就是:

  GET  test

  这样我们返回的就是test的内容

  GET  test23123

  这个使我们没有保存的值,就会返回(nil)

5、多字符串回复

  所谓的多字符串回复是指:

  例如:我们创建了test1,test2,test3,

  那么我们来看下结果

  SET  test1  'this is a test1'

  SET  test2  'this is a test2'

  SET  test3  'this is a test3'

  

  上面是写进去的结果,那接下来看下怎么返回多字符串

  我们使用命令:KEYS  *

  

  这就是我们的多字符串返回值

 

posted @ 2018-09-22 16:51  python入门小菜鸟  阅读(99)  评论(0编辑  收藏  举报