- 用法
-
COMMAND DOCS [ 命令名称 ] [ [ 命令名称 ] ... ]
- 复杂度
- O(N),其中 N 是要查找的命令数量
- 起始版本
- 7.0.0
- ACL 分类
- @connection, @slow
- summary: 简短的命令描述。
- since: 添加该命令的 Valkey 版本(对于模块命令,是模块版本)。
- group: 命令所属的功能组。可能的值包括:
- 位图
- 集群
- 连接
- 通用
- 地理
- 哈希
- 超日志计数
- 列表
- 模块
- 发布/订阅
- 脚本
- 哨兵
- 服务器
- 集合
- 有序集合
- 流
- 字符串
- 事务
- complexity: 关于命令时间复杂度的简短解释。
- doc_flags: 文档标志数组。可能的值包括:
- deprecated: 该命令已弃用。
- syscmd: 不应由用户调用的系统命令。
- deprecated_since: 弃用该命令的 Valkey 版本(对于模块命令,是模块版本)。
- replaced_by: 已弃用命令的替代方案。
- history: 描述命令输出或参数更改的历史注释数组。它不应包含有关行为更改的信息。每个条目本身都是一个数组,由两个元素组成:
- 该条目适用的 Valkey 版本。
- 更改的描述。
- arguments: 描述命令参数的映射数组。有关更多信息,请参阅Valkey 命令参数页面。
返回关于命令的文档信息。
默认情况下,回复包含服务器的所有命令。您可以使用可选的 command-name 参数来指定一个或多个命令的名称。
回复中包含每个返回命令的映射。映射的回复中可能包含以下键:
示例
127.0.0.1:6379> COMMAND DOCS SET
1) "set"
2) 1) "summary"
2) "Sets the string value of a key, ignoring its type. The key is created if it doesn't exist."
3) "since"
4) "1.0.0"
5) "group"
6) "string"
7) "complexity"
8) "O(1)"
9) "history"
10) 1) 1) "2.6.12"
2) "Added the `EX`, `PX`, `NX` and `XX` options."
2) 1) "6.0.0"
2) "Added the `KEEPTTL` option."
3) 1) "6.2.0"
2) "Added the `GET`, `EXAT` and `PXAT` option."
4) 1) "7.0.0"
2) "Allowed the `NX` and `GET` options to be used together."
11) "arguments"
12) 1) 1) "name"
2) "key"
3) "type"
4) "key"
5) "display_text"
6) "key"
7) "key_spec_index"
8) (integer) 0
2) 1) "name"
2) "value"
3) "type"
4) "string"
5) "display_text"
6) "value"
3) 1) "name"
2) "condition"
3) "type"
4) "oneof"
5) "since"
6) "2.6.12"
7) "flags"
8) 1) optional
9) "arguments"
10) 1) 1) "name"
2) "nx"
3) "type"
4) "pure-token"
5) "display_text"
6) "nx"
7) "token"
8) "NX"
2) 1) "name"
2) "xx"
3) "type"
4) "pure-token"
5) "display_text"
6) "xx"
7) "token"
8) "XX"
4) 1) "name"
2) "get"
3) "type"
4) "pure-token"
5) "display_text"
6) "get"
7) "token"
8) "GET"
9) "since"
10) "6.2.0"
11) "flags"
12) 1) optional
5) 1) "name"
2) "expiration"
3) "type"
4) "oneof"
5) "flags"
6) 1) optional
7) "arguments"
8) 1) 1) "name"
2) "seconds"
3) "type"
4) "integer"
5) "display_text"
6) "seconds"
7) "token"
8) "EX"
9) "since"
10) "2.6.12"
2) 1) "name"
2) "milliseconds"
3) "type"
4) "integer"
5) "display_text"
6) "milliseconds"
7) "token"
8) "PX"
9) "since"
10) "2.6.12"
3) 1) "name"
2) "unix-time-seconds"
3) "type"
4) "unix-time"
5) "display_text"
6) "unix-time-seconds"
7) "token"
8) "EXAT"
9) "since"
10) "6.2.0"
4) 1) "name"
2) "unix-time-milliseconds"
3) "type"
4) "unix-time"
5) "display_text"
6) "unix-time-milliseconds"
7) "token"
8) "PXAT"
9) "since"
10) "6.2.0"
5) 1) "name"
2) "keepttl"
3) "type"
4) "pure-token"
5) "display_text"
6) "keepttl"
7) "token"
8) "KEEPTTL"
9) "since"
10) "6.0.0"
RESP2 回复
数组回复:一个映射,作为扁平化数组,其中每个键是命令名称,每个值是文档信息。
RESP3 回复
映射回复:一个映射,其中每个键是命令名称,每个值是文档信息。