Redis-key
http://redis.cn/commands.html
官网查询
127.0.0.1:6379> keys * #查看所有key
(empty array)
127.0.0.1:6379> set name bowenxu #设置key
OK
127.0.0.1:6379> keys *
1) "name"
127.0.0.1:6379> set age 1
OK
127.0.0.1:6379> keys *
1) "age"
2) "name"
127.0.0.1:6379> exists name #key是否存在
(integer) 1
127.0.0.1:6379> exists name1
(integer) 0
127.0.0.1:6379> move name 1 #移动到别的数据库
(integer) 1
127.0.0.1:6379> keys *
1) "age"
127.0.0.1:6379> set name bowenxu007
OK
127.0.0.1:6379> get name
"bowenxu007"
127.0.0.1:6379> expire name 10 #设置过期时间
(integer) 1
127.0.0.1:6379> ttl name #查看key的寿命
(integer) 4
127.0.0.1:6379> ttl name
(integer) 1
127.0.0.1:6379> ttl name
(integer) 0
127.0.0.1:6379> ttl name
(integer) -2
127.0.0.1:6379> get name
(nil)
127.0.0.1:6379> type age #查看key的类型
string