script

英[skrɪpt] 美[skrɪpt]

n.Script, handwriting; written typeface; script, broadcast script or movie script

vt.Write a script for a movie (or drama, etc.); make up

Third person singular: scripts Plural: scripts Present participle: scripting Past tense: scripted Past participle: scripted

exist

UK[ɪgˈzɪst] US[ɪɡˈzɪst]

##vi.Existence; survive; life; continue to exist

Third person singular: exists Present participle: existing Past tense: existed Past participle: existed

redis SCRIPT EXISTS command syntax

Function:Given the SHA1 checksum of one or more scripts, return a list containing 0 and 1, indicating whether the script specified by the checksum has been saved in the cache.

Syntax:SCRIPT EXISTS script [script ...]

Available versions:>= 2.6.0

Time complexity:O(N), N is the number of given SHA1 checksums.

Return:A list containing 0 and 1. The former indicates that the script does not exist in the cache, and the latter indicates that the script is already in the cache. The elements in the list maintain a corresponding relationship with the given SHA1 checksum. For example, the value of the third element of the list represents the status of the script specified by the third SHA1 checksum in the cache.

redis SCRIPT EXISTS command example

redis> SCRIPT LOAD "return 'hello moto'" # 载入一个脚本 "232fd51614574cf0867b83d384a5e898cfd24e5a" redis> SCRIPT EXISTS 232fd51614574cf0867b83d384a5e898cfd24e5a 1) (integer) 1 redis> SCRIPT FLUSH # 清空缓存 OK redis> SCRIPT EXISTS 232fd51614574cf0867b83d384a5e898cfd24e5a 1) (integer) 0