设置字典内容
redis 127.0.0.1:6379> SET runooobkey redis
OK
查看字典内容
redis 127.0.0.1:6379> GET runooobkey
“redis”
设置字典过期时间
- 为 key 设置过期时间:
redis 127.0.0.1:6379> EXPIRE runooobkey 60
(integer) 1
redis 127.0.0.1:6379> SET runooobkey redis
OK
redis 127.0.0.1:6379> GET runooobkey
“redis”
redis 127.0.0.1:6379> EXPIRE runooobkey 60
(integer) 1