文章目录

hmmzhtx

记录精彩的程序人生

redis 基本简单使用:一 有更新!

  hmmzhtx

    查看键值是否存在:exists

    redis> SET key1 "Hello"
    "OK"
    redis> EXISTS key1
    (integer) 1
    redis> EXISTS nosuchkey
    (integer) 0
    redis> SET key2 "World"
    "OK"
    redis> EXISTS key1 key2 nosuchkey
    (integer) 2
    redis> 
    

    字符添加方法:append

    redis> APPEND mykey "Hello"
    (integer) 5
    redis> APPEND mykey " World"
    (integer) 11
    redis> GET mykey
    "Hello World"
    redis>