Redis Psetex 命令

Redis 教程 · 2019-03-07 06:58:32

Redis Psetex 命令以毫秒为单位设置 key 的生存时间。

语法

redis Psetex 命令基本语法如下:

redis 127.0.0.1:6379> PSETEX key1 EXPIRY_IN_MILLISECONDS value1 

可用版本

>= 2.6.0

返回值

设置成功时返回 OK 。

实例

redis 127.0.0.1:6379> PSETEX mykey 1000 "Hello"
OK
redis 127.0.0.1:6379> PTTL mykey
999
redis 127.0.0.1:6379> GET mykey
1) "Hello"

点击查看所有 Redis 教程 文章: https://codercto.com/courses/l/33.html

查看所有标签

Code Reading

Code Reading

Diomidis Spinellis / Addison-Wesley Professional / 2003-06-06 / USD 64.99

This book is a unique and essential reference that focuses upon the reading and comprehension of existing software code. While code reading is an important task faced by the vast majority of students,......一起来看看 《Code Reading》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具