Skip to content
Search ffkv docs

Search the complete handbook, locally.

    HSETEX

    Set the value of one or more fields of a given hash key, and optionally set their expiration.

    Browse all commands · Upstream source documentation

    Reference fieldValue
    Canonical nameHSETEX
    Catalog groupHash commands
    Upstream since8.0.0 — upstream Redis/module version, not an ffkv release
    Pinned catalogRedis 8.10.0
    HSETEX key [FNX | FXX] [EX seconds | PX milliseconds |
    EXAT unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL]
    FIELDS numfields field value [field value ...]

    Hash fields have independent expiration. Counted field forms use FIELDS n; HSETEX counts field/value pairs. Key TTL and field TTL are distinct.

    Source: README.md:587–599; tests/bdd/features/hashes.feature.

    All requests share the 8 MiB framing/1,024-argument ingress limit; normal RESP replies have 64 MiB wire/logical budgets with bounded nesting/value counts. Management and Lua origins impose smaller budgets. These are not a process RSS cap. Catalog inclusion is not exhaustive option or wire-format parity. See limits and compatibility.

    The following fields come from the pinned Redis metadata, not measured ffkv performance or an assertion that ffkv enforces every upstream flag. Running COMMAND INFO/COMMAND DOCS describe the current engine.

    Upstream Redis complexity: O(N) where N is the number of fields being set.

    Upstream arity: -6 (includes the command name; a negative number is a minimum).

    Command flags: WRITE, DENYOOM, FAST.

    ACL categories: HASH.

    ArgumentTypeConstraints / metadata
    keykeykey_spec_index: 0
    conditiononeofoptional
    ↳ fnxpure-tokentoken: FNX
    ↳ fxxpure-tokentoken: FXX
    expirationoneofoptional
    ↳ secondsintegertoken: EX
    ↳ millisecondsintegertoken: PX
    ↳ unix-time-secondsunix-timetoken: EXAT
    ↳ unix-time-millisecondsunix-timetoken: PXAT
    ↳ keepttlpure-tokentoken: KEEPTTL
    fieldsblocktoken: FIELDS
    ↳ numfieldsintegerRequired
    ↳ datablockmultiple
    ↳ ↳ fieldstringRequired
    ↳ ↳ valuestringRequired

    Upstream key discovery descriptors (indexes are relative to the full command vector):

    [
    {
    "flags": [
    "RW",
    "UPDATE"
    ],
    "begin_search": {
    "index": {
    "pos": 1
    }
    },
    "find_keys": {
    "range": {
    "lastkey": 0,
    "step": 1,
    "limit": 0
    }
    }
    }
    ]
    Additional pinned upstream metadata
    {
    "group": "hash",
    "since": "8.0.0"
    }

    Metadata source · Local snapshot: src/command_metadata.json, key hsetex.

    These are source observations, not a test run performed by this documentation build. A tag identifies scenario intent; an extracted vector identifies a command invocation, which may intentionally produce an error. Scenarios may require setup, multiple connections, persistence, cluster nodes or native-module fixtures.

    • All-fields conditions are atomic and keep existing field expirations — tests/bdd/features/hashes.feature:430; command tag and invocation observed.
    • Counted field blocks permit trailing options and keyword field names — tests/bdd/features/hashes.feature:1323; command tag and invocation observed.

    The following JSON arrays are the test harness’s argument vectors, not shell commands. Numeric arguments are converted by the harness; objects of the form {"base64":"…"} represent decoded binary bytes, not a literal JSON command argument. Preserve scenario setup and connection ordering. See the CLI guide for shell quoting and binary stdin. No reply is invented or inferred.

    All-fields conditions are atomic and keep existing field expirations — tests/bdd/features/hashes.feature:468 (I execute:)

    [
    "HSETEX",
    "h",
    "PXAT",
    "1",
    "FIELDS",
    "1",
    "a",
    "gone"
    ]

    Next source assertion: the reply equals:

    1

    Counted field blocks permit trailing options and keyword field names — tests/bdd/features/hashes.feature:1345 (I execute:)

    [
    "HSETEX",
    "h",
    "FIELDS",
    "1",
    "EX",
    "new",
    "FXX",
    "KEEPTTL"
    ]

    Next source assertion: the reply equals:

    1

    All-fields conditions are atomic and keep existing field expirations — tests/bdd/features/hashes.feature:436 (I execute:)

    [
    "HSETEX",
    "h",
    "FNX",
    "FIELDS",
    "2",
    "a",
    "changed",
    "b",
    "new"
    ]

    Next source assertion: the reply equals:

    0