• Jo's avatar
    Update `FIELDS` argument to block type for HFE commands schema (#13339) · 871c9859
    Jo authored
    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.
    871c9859
hpexpiretime.json 2.4 KB