Redis Expire 命令

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

Redis Expire 命令用于设置 key 的过期时间,key 过期后将不再可用。单位以秒计。

语法

redis 127.0.0.1:6379> Expire KEY_NAME TIME_IN_SECONDS

返回值

设置成功返回 1 。 当 key 不存在或者不能为 key 设置过期时间时返回 0 。

实例

实例1:

127.0.0.1:6379> exists domain
(integer) 1
127.0.0.1:6379> expire domain 120
(integer) 1
127.0.0.1:6379> ttl domain
(integer) 117

实例2:当 key 不存在

127.0.0.1:6379> exists domain2
(integer) 0
127.0.0.1:6379> expire domain2 120
(integer) 0

查看更多 Redis key 命令

ppk on JavaScript, 1/e

ppk on JavaScript, 1/e

Peter-Paul Koch / New Riders Press / 2006-09-20 / USD 44.99

Whether you're an old-school scripter who needs to modernize your JavaScripting skills or a standards-aware Web developer who needs best practices and code examples, you'll welcome this guide from a J......一起来看看 《ppk on JavaScript, 1/e》 这本书的介绍吧!

RGB转16进制工具

RGB转16进制工具

RGB HEX 互转工具

随机密码生成器

随机密码生成器

多种字符组合密码

URL 编码/解码

URL 编码/解码

URL 编码/解码