English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Redis GET command is used to retrieve the value of the specified key. If the key does not exist, it returns nil. If the value stored in the key is not a string type, it returns an error.
The basic syntax of the Redis GET command is as follows:
redis 127.0.0.1:6379> GET KEY_NAME
>= 1.0.0
Returns the value of the key, or nil if the key does not exist. If the key is not a string type, an error is returned.
# GET operation against a non-existent key or a string type key redis> GET db (nil) redis> SET db redis OK redis> GET db "redis" # GET operation against a non-string key redis> DEL db (integer) 1 redis> LPUSH db redis mongodb mysql (integer) 3 redis> GET db (error) ERR Operation against a key holding the wrong kind of value