Redis PERSIST 命令

更新时间: 2019-07-07 15:54

Redis PERSIST 命令用于移除给定 key 的过期时间,使得 key 永不过期。

语法

redis 127.0.0.1:6379> PERSIST KEY_NAME

返回值

  • 当过期时间移除成功时,返回 1 。

  • 如果 key 不存在或 key 没有设置过期时间,返回 0 。

实例

127.0.0.1:6379> setex domain 300 www.codercto.com
OK
127.0.0.1:6379> ttl domain
(integer) 296
127.0.0.1:6379> persist domain
(integer) 1
127.0.0.1:6379> ttl domain
(integer) -1
127.0.0.1:6379> get domain
"www.codercto.com"

# key 没有过期时间
127.0.0.1:6379> persist domain
(integer) 0

# key 不存在
127.0.0.1:6379> persist domain1
(integer) 0

查看更多 Redis key 命令

PCI Express 体系结构导读

PCI Express 体系结构导读

王齐 / 机械工业 / 2010-3 / 55.00元

《PCI Express 体系结构导读》讲述了与PCI及PCI Express总线相关的最为基础的内容,并介绍了一些必要的、与PCI总线相关的处理器体系结构知识,这也是《PCI Express 体系结构导读》的重点所在。深入理解处理器体系结构是理解PCI与PCI Express总线的重要基础。 读者通过对《PCI Express 体系结构导读》的学习,可超越PCI与PCI Express总线......一起来看看 《PCI Express 体系结构导读》 这本书的介绍吧!

URL 编码/解码

URL 编码/解码

URL 编码/解码

SHA 加密

SHA 加密

SHA 加密工具

HEX HSV 转换工具

HEX HSV 转换工具

HEX HSV 互换工具