Redis Script Exists 命令

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

Redis Script Exists 命令用于校验指定的脚本是否已经被保存在缓存当中。

语法

redis Script Exists 命令基本语法如下:

SCRIPT EXISTS sha1 [sha1 ...]

可用版本

>= 2.6.0

返回值

一个列表,包含 0 和 1 ,前者表示脚本不存在于缓存,后者表示脚本已经在缓存里面了。

列表中的元素和给定的 SHA1 校验和保持对应关系,比如列表的第三个元素的值就表示第三个 SHA1 校验和所指定的脚本在缓存中的状态。

实例

redis 127.0.0.1:6379> SCRIPT LOAD "return 'hello moto'"    # 载入一个脚本
"232fd51614574cf0867b83d384a5e898cfd24e5a"

redis 127.0.0.1:6379> SCRIPT EXISTS 232fd51614574cf0867b83d384a5e898cfd24e5a
1) (integer) 1

redis 127.0.0.1:6379> SCRIPT FLUSH     # 清空缓存
OK

redis 127.0.0.1:6379> SCRIPT EXISTS 232fd51614574cf0867b83d384a5e898cfd24e5a
1) (integer) 0

查看更多 Redis 脚本命令

Natural Language Processing with Python

Natural Language Processing with Python

Steven Bird、Ewan Klein、Edward Loper / O'Reilly Media / 2009-7-10 / USD 44.99

This book offers a highly accessible introduction to Natural Language Processing, the field that underpins a variety of language technologies, ranging from predictive text and email filtering to autom......一起来看看 《Natural Language Processing with Python》 这本书的介绍吧!

Base64 编码/解码

Base64 编码/解码

Base64 编码/解码

XML 在线格式化

XML 在线格式化

在线 XML 格式化压缩工具

html转js在线工具

html转js在线工具

html转js在线工具