127.0.0.1:6379> keys site
1) "site"
127.0.0.1:6379> keys s*
1) "site"
127.0.0.1:6379> keys si?e
1) "site"
127.0.0.1:6379> keys sit[ey]
1) "site"
127.0.0.1:6379> randomkey
"age"
127.0.0.1:6379> randomkey
"site"
127.0.0.1:6379> type age
127.0.0.1:6379> exists site
(integer) 1
127.0.0.1:6379> exists sit
(integer) 0
127.0.0.1:6379> del age
(integer) 1
127.0.0.1:6379> rename site wangzhi
OK
127.0.0.1:6379> set site dbase.cc
OK
127.0.0.1:6379> set search baidu.com
OK
127.0.0.1:6379> rename site search
OK
127.0.0.1:6379> get search
"dbase.cc"
127.0.0.1:6379> set site dbase.cc
OK
127.0.0.1:6379> set search baidu.com
OK
127.0.0.1:6379> keys *
1) "site"
2) "search"
127.0.0.1:6379> renamenx site search
(integer) 0
127.0.0.1:6379> get search
"baidu.com"
127.0.0.1:6379> move search 1
(integer) 1
127.0.0.1:6379> keys *
1) "site"
127.0.0.1:6379> select 1
OK
127.0.0.1:6379[1]> keys *
1) "search"
127.0.0.1:6379> select 0
OK
127.0.0.1:6379> keys *
1) "site"
127.0.0.1:6379> ttl site
(integer) -1
127.0.0.1:6379> ttl age
(integer) -2
127.0.0.1:6379> expire site 10
(integer) 1
127.0.0.1:6379> get site
"dbase.cc"
127.0.0.1:6379> get site
(nil)
127.0.0.1:6379> expire site 10
(integer) 0
127.0.0.1:6379> set site dbase.cc
OK
127.0.0.1:6379> ttl site
(integer) -1
127.0.0.1:6379> pexpire site 9000
(integer) 1
127.0.0.1:6379> pttl site
(integer) 3896
127.0.0.1:6379> pttl site
(integer) 216
127.0.0.1:6379> pttl site
(integer) -2
127.0.0.1:6379> set site dbase.cc
OK
127.0.0.1:6379> ttl site
(integer) -1
127.0.0.1:6379> expire site 20
(integer) 1
127.0.0.1:6379> ttl site
(integer) 15
127.0.0.1:6379> persist site
(integer) 1
127.0.0.1:6379> ttl site
(integer) -1
127.0.0.1:6379> get site
"dbase.cc"
|