Files
redis/src/commands
Jo 871c985919 Update FIELDS argument to block type for HFE commands schema (#13339)
I reviewed `XREAD` command syntax:
```
XREAD [COUNT count] [BLOCK milliseconds] STREAMS key [key ...] id [id ...]
```

Here’s the structure for `XREAD`:
```json
"arguments": [
            {
                "token": "COUNT",
                "name": "count",
                "type": "integer",
                "optional": true
            },
            {
                "token": "BLOCK",
                "name": "milliseconds",
                "type": "integer",
                "optional": true
            },
            {
                "name": "streams",
                "token": "STREAMS",
                "type": "block",
                "arguments": [
                    {
                        "name": "key",
                        "type": "key",
                        "key_spec_index": 0,
                        "multiple": true
                    },
                    {
                        "name": "ID",
                        "type": "string",
                        "multiple": true
                    }
                ]
            }
]
```

Now, consider the `HEXPIRE` syntax:
```
HEXPIRE key seconds [NX | XX | GT | LT] FIELDS numfields field [field ...]
```

Since the `FIELDS` token functions similarly to `STREAMS`, and given that `STREAMS` is defined as a block, I believe the `FIELDS` in `hepxire` should also be defined as a block.
2024-06-14 13:51:49 +08:00
..
2023-04-20 11:50:28 +03:00
2023-04-20 11:50:28 +03:00

This directory contains JSON files, one for each of Redis commands.

Each JSON contains all the information about the command itself, but these JSON files are not to be used directly! Any third party who needs access to command information must get it from COMMAND INFO and COMMAND DOCS. The output can be extracted in a JSON format by using redis-cli --json, in the same manner as in utils/generate-commands-json.py.

The JSON files are used to generate commands.def (and https://github.com/redis/redis-doc/blob/master/commands.json) in Redis, and despite looking similar to the output of COMMAND there are some fields and flags that are implicitly populated, and that's the reason one shouldn't rely on the raw files.

The structure of each JSON is somewhat documented in https://redis.io/commands/command-docs/ and https://redis.io/commands/command/

The reply_schema section is a standard JSON Schema (see https://json-schema.org/) that describes the reply of each command. It is designed to someday be used to auto-generate code in client libraries, but is not yet mature and is not exposed externally.