- Redis Basics
- Redis - Home
- Redis - Overview
- Redis - Environment
- Redis - Configuration
- Redis - Data types
- Redis Commands
- Redis - Commands
- Redis - Keys
- Redis - Strings
- Redis - Hashes
- Redis - Lists
- Redis - Sets
- Redis - Sorted Sets
- Redis - HyperLogLog
- Redis - Publish Subscribe
- Redis - Transactions
- Redis - Scripting
- Redis - Connections
- Redis - Server
- Redis Advanced
- Redis - Backup
- Redis - Security
- Redis - Benchmarks
- Redis - Client Connection
- Redis - Pipelining
- Redis - Partitioning
- Redis - Java
- Redis - Php
- Redis Useful Resources
- Redis - Quick Guide
- Redis - Useful Resources
- Redis - Discussion
Redis - Keys Exists Command
Redis EXISTS command is used to check whether the key exists in Redis or not.
Return Value
Integer value
- 1, if the key exists.
- 0, if the key does not exist.
Syntax
Following is the basic syntax of Redis EXISTS command.
redis 127.0.0.1:6379> EXISTS KEY_NAME
Example
redis 127.0.0.1:6379> EXISTS tutorialspoint-new-key (integer) 0
Now, create a key with the name tutorialspoint-new-key and check for its existence.
redis 127.0.0.1:6379> EXISTS tutorialspoint-new-key (integer) 1
redis_keys.htm
Advertisements