如何設定redis中hash的field的expire ?

weixin_30588675發表於2020-04-05
redis 127.0.0.1:6379> hset expire:me name tom
(integer) 0
redis 127.0.0.1:6379> hget expire:me name
"tom"

redis 127.0.0.1:6379> expire expire:me 10
(integer) 1
redis 127.0.0.1:6379> ttl expire:me
(integer) 8

...
...
...

redis 127.0.0.1:6379> ttl expire:me
(integer) -1
redis 127.0.0.1:6379> hget expire:me name
(nil)

 

轉載於:https://www.cnblogs.com/archoncap/p/6151067.html

相關文章