Redis - String Get Command


Advertisements

Redis GET command is used to get the value stored in the specified key. If the key does not exist, then nil is returned. If the returned value is not a string, then error is returned.

Return Value

Simple string reply. Value or key or nil.

Syntax

Following is the basic syntax of Redis GET command.

redis 127.0.0.1:6379> GET KEY_NAME

Example

First, set a key in Redis and then get it.

redis 127.0.0.1:6379> SET tutorialspoint redis 
OK 
redis 127.0.0.1:6379> GET tutorialspoint 
"redis" 
redis_strings.htm
Advertisements