Saturday, 11 April 2015

GET key : Get the value of the key


Syntax
GET key
     Gets the value of the key.

Returns
Returns the value of key, or nil when key does not exist.

127.0.0.1:6379> set var "Hello redis" 
OK 
127.0.0.1:6379> get var 
"Hello redis" 
127.0.0.1:6379> get var1 
(nil) 


GET” command works on strings only, if you tries to perform this operation on other data types, error thrown.

127.0.0.1:6379> sadd empIds 1 2 5 6 3 4 
(integer) 6 
127.0.0.1:6379> get empIds 
(error) WRONGTYPE Operation against a key holding the wrong kind of value

Prevoius                                                 Next                                                 Home

No comments:

Post a Comment