YouTip LogoYouTip

Scripting Script Exists

Here's the translated HTML content with all code blocks and HTML tags preserved: # Redis Script Exists Command | Rookie Tutorial # [Rookie Tutorial -- Learning Not Just Technology, But Dreams!](#) * (javascript:void(0);) * (javascript:void(0);) * (javascript:void(0);) * (javascript:void(0)) Redis Tutorial (#)(#)(#)(#)(#) ## Redis Commands (#)(#)(#)(#)(#)(#)(#)(#)[Redis Pub/Sub](#)(#)(#)(#)(#)(#)(#) ## Redis Advanced Tutorial [Redis Backup & Recovery](#)(#)(#)(#)(#)(#)(#)(#) [](#)(#) (#)[](#) In-depth Exploration Search Engines Scripting Languages Development Tools Web Design & Development Search Internet & Telecommunications Computer Science Programming Education Social Sciences # Redis Script Exists Command !(#)(#) The Redis Script Exists command is used to check if specified scripts exist in the script cache. ### Syntax The basic syntax of redis Script Exists command is as follows: SCRIPT EXISTS sha1 [sha1 ...] ### Available Version >= 2.6.0 ### Return Value A list containing 0 and 1, where 0 indicates the script does not exist in cache, and 1 indicates the script exists in cache. The elements in the list correspond to the given SHA1 checksums in order. For example, the value of the third element in the list represents the cache status of the script specified by the third SHA1 checksum. ### Example redis 127.0.0.1:6379> SCRIPT LOAD "return 'hello moto'" # Load a script"232fd51614574cf0867b83d384a5e898cfd24e5a" redis 127.0.0.1:6379> SCRIPT EXISTS 232fd51614574cf0867b83d384a5e898cfd24e5a1) (integer) 1 redis 127.0.0.1:6379> SCRIPT FLUSH # Clear cache OK redis 127.0.0.1:6379> SCRIPT EXISTS 232fd51614574cf0867b83d384a5e898cfd24e5a1) (integer) 0 !(#)(#)
← Redis ServerConnection Select β†’