Redis Client Getname 命令

更新时间: 2019-07-07 15:54

Redis Client Getname 命令用于返回 CLIENT SETNAME 命令为连接设置的名字。 因为新创建的连接默认是没有名字的, 对于没有名字的连接, CLIENT GETNAME 返回空白回复。

语法

redis Client Getname 命令基本语法如下:

redis 127.0.0.1:6379> CLIENT GETNAME

可用版本

>= 2.6.9

返回值

如果连接没有设置名字,那么返回空白回复; 如果有设置名字,那么返回名字。

实例

# 新连接默认没有名字

redis 127.0.0.1:6379> CLIENT GETNAME
(nil)

# 设置名字

redis 127.0.0.1:6379> CLIENT SETNAME hello-world-connection
OK

# 返回名字

redis 127.0.0.1:6379> CLIENT GETNAME
"hello-world-connection"

查看更多 Redis 服务器命令

The Book of CSS3

The Book of CSS3

Peter Gasston / No Starch Press / 2011-5-13 / USD 34.95

CSS3 is the technology behind most of the eye-catching visuals on the Web today, but the official documentation can be dry and hard to follow. Luckily, The Book of CSS3 distills the heady technical la......一起来看看 《The Book of CSS3》 这本书的介绍吧!

JSON 在线解析

JSON 在线解析

在线 JSON 格式化工具

MD5 加密

MD5 加密

MD5 加密工具

正则表达式在线测试

正则表达式在线测试

正则表达式在线测试