SCRIPT EXISTS

SCRIPT EXISTS sha1 [sha1 ...]
Available since:
Redis Open Source 2.6.0
Time complexity:
O(N) with N being the number of scripts to check (so checking a single script is an O(1) operation).
ACL categories:
@slow, @scripting,
Compatibility:
Redis Software and Redis Cloud compatibility

Returns information about the existence of the scripts in the script cache.

This command accepts one or more SHA1 digests and returns a list of 1 and 0 values to indicate whether each script exists in the script cache. Before you run a pipeline, use this command to check whether Redis has loaded the scripts you need. For missing scripts, use SCRIPT LOAD; then use EVALSHA instead of EVAL in the pipeline to save bandwidth.

For more information about EVAL scripts see Introduction to Eval Scripts.

Required arguments

sha1 [sha1 ...]

One or more SHA1 digests to look up in the script cache.

Redis Software and Redis Cloud compatibility

Redis
Software
Redis
Cloud
Notes
✅ Standard
✅ Active-Active
✅ Standard
✅ Active-Active

Return information

Array reply: an array of integers that correspond to the specified SHA1 digest arguments.
RATE THIS PAGE
Back to top ↑