In the key operation key redis

keys * / View all key

remoteSelf:1>select 0
"OK"
remoteSelf:0>keys *
 1)  "SUBCRIBEMAP"
 2)  "test"

exists key name / determine whether there is a key

# 不存在返回0
remoteSelf:0>exists aaa
"0"
# 存在返回1
remoteSelf:0>exists test
"1"

move key db / current from the library to the library db

The expire key seconds / set the expiration time to the given key

ttl key / key there is to see how long expired, -1 means never expires, -2 not already expired

type key / key is to see what type

Guess you like

Origin www.cnblogs.com/eternityz/p/12273264.html