Redis Setex 命令

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

Redis Setex 命令为指定的 key 设置值及其过期时间。如果 key 已经存在, SETEX 命令将会替换旧的值。

语法

redis 127.0.0.1:6379> SETEX KEY_NAME TIMEOUT VALUE

过期时间的单位:秒

返回值

设置成功时返回 OK 。

实例

127.0.0.1:6379> setex domain 10 www.codercto.com
OK
127.0.0.1:6379> ttl domain
7
127.0.0.1:6379> get domain
www.codercto.com

查看更多 Redis 字符串(String)命令

The Everything Store

The Everything Store

Brad Stone / Little, Brown and Company / 2013-10-22 / USD 28.00

The definitive story of Amazon.com, one of the most successful companies in the world, and of its driven, brilliant founder, Jeff Bezos. Amazon.com started off delivering books through the mail. Bu......一起来看看 《The Everything Store》 这本书的介绍吧!

HTML 编码/解码

HTML 编码/解码

HTML 编码/解码

XML、JSON 在线转换

XML、JSON 在线转换

在线XML、JSON转换工具

HEX CMYK 转换工具

HEX CMYK 转换工具

HEX CMYK 互转工具