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 服务器命令

Effective Modern C++

Effective Modern C++

Scott Meyers / O'Reilly Media / 2014-12 / USD 49.99

Learn how to program expertly with C++ with this practical book from Scott Meyers, one of the world's foremost authorities on this systems programming language. Scott Meyers takes some of the most dif......一起来看看 《Effective Modern C++》 这本书的介绍吧!

在线进制转换器

在线进制转换器

各进制数互转换器

html转js在线工具

html转js在线工具

html转js在线工具

RGB HSV 转换

RGB HSV 转换

RGB HSV 互转工具