GET key
This command get the value of the specified key. If the key does not exist the special value 'nil' is returned.
If the value stored at the key is not a string an error is returned because GET can only handle string values.
TIME COMPLEXITY: O(1)
RETURN VALUE: Return the value associated with the key in Redis.
Syntax:
GET KEY_NAME
Example 1: When the key is present
redis:6379> GET redisKey"1000"
Output
"1000"
Example 2: When the key is not present
redis:6379> GET redisKey(nil)
Output
nil
No comments:
Post a Comment