w3resource

Redis Scripting: SCRIPT EXISTS script [script ...]

Description

Redis SCRIPT EXISTS command is used to return information about the existence of the scripts in the script cache. This command accepts one or more SHA1 digests and returns a list of ones or zeros to signal if the scripts are already defined or not inside the script cache.

Syntax:

SCRIPT EXISTS script [script ...]

Available since

2.6.0.

Return Value

Array reply The command returns an array of integers that correspond to the specified SHA1 digest arguments. For every corresponding SHA1 digest of a script that actually exists in the script cache, and 1 is returned, otherwise, 0 is returned.

Return Value Type

Array

Example:

redis 127.0.0.1:6379> SCRIPT LOAD "return 1"
ERR Unknown or disabled command 'SCRIPT'
redis 127.0.0.1:6379> SCRIPT EXISTS ff9d4800c877a703b823dsdsfsffewfwefwefweac0578ff8db
ERR Unknown or disabled command 'SCRIPT'

Previous: EVALSHA
Next: SCRIPT FLUSH



Follow us on Facebook and Twitter for latest update.