SCRIPT EXISTS
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.
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
| Always | Array with one integer per digest: 1 if cached, 0 if not |
Array |
Examples
Section titled “Examples”127.0.0.1:6379> SCRIPT LOAD "return ARGV[1]""098e0f0d1448c0a81dafe820f66d460eb09263da"127.0.0.1:6379> SCRIPT EXISTS 098e0f0d1448c0a81dafe820f66d460eb09263da 00000000000000000000000000000000000000001) (integer) 12) (integer) 0Compatibility
Section titled “Compatibility”Same as Redis 7 and Valkey 8.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.