redis的expire总结

 在排查问题的时候,对这个知识点有点模糊,实操了下。String和其他redis数据结构expire是不一样的。

String 有点不一样:

具体见我置顶的博文redis手写总结

1.2.3 容器型数据结构的通用规则

list,set,hash,zset 是容器型数据结构
create if not exists
drop if no ellements

1.2.4 过期时间

过期是以对象为单位的,比如一个hash结构的过期是整个hash对象的过期,而不是其中某个子key的过期
注意:如果一个字符串已经设置了过期时间,然后用set方法修改了它,他的过期时间就会消失

set codehole yoyo
expire codehole 600
tll codehole
set codehole yoyo
ttl codehole

猜你喜欢

转载自blog.csdn.net/qq_32907195/article/details/112792808