Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

SCRIPT EXISTS

Last updated
SCRIPT EXISTS sha1 [sha1 ...]
Group
Scripting and functions
Complexity
O(N) for N digests
Arity
-3 (at least 3 words, counting the command name)
HotKV Cloud
All plans
On-Premise
no license needed

SCRIPT EXISTS tells you, for each SHA1 digest, whether the script is cached and can be run with EVALSHA. Digests are compared without case.

Case RESP2 RESP3
Always Array with one integer per digest: 1 if cached, 0 if not Array
127.0.0.1:6379> SCRIPT LOAD "return ARGV[1]"
"098e0f0d1448c0a81dafe820f66d460eb09263da"
127.0.0.1:6379> SCRIPT EXISTS 098e0f0d1448c0a81dafe820f66d460eb09263da 0000000000000000000000000000000000000000
1) (integer) 1
2) (integer) 0

Same as Redis 7 and Valkey 8.

SCRIPT LOAD, EVALSHA