English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Redis Client Getname command is used to return CLIENT SETNAME The name set for the connection by the command. Because new connections are not named by default, CLIENT GETNAME returns a blank reply for connections without a name.
The basic syntax of the redis Client Getname command is as follows:
redis 127.0.0.1:6379> CLIENT GETNAME
>= 2.6.9
If the connection is not named, then return a blank reply; If a name is set, then return the name.
# New connections are not named by default redis 127.0.0.1:6379> CLIENT GETNAME (nil) # Set name redis 127.0.0.1:6379> CLIENT SETNAME hello-world-connection OK # Return name redis 127.0.0.1:6379> CLIENT GETNAME "hello-world-connection"