Skip to content

HEXPIRE command not working #3352

Closed
@lakshaykumar05

Description

@lakshaykumar05

using this redis version ("github.com/redis/go-redis/v9")

hashKey := "exampleHash"
field1 := "field1"
value1 := "value1"
expiration := 40 * time.Second

// Set a field in the hash
err = rdb.HSet(ctx, hashKey, field1, value1).Err()
if err != nil {
    return
}

// Set expiration for the hash field
err = rdb.HExpire(ctx, hashKey, expiration, field1).Err()
if err != nil {
   return
}

HEXPIRE command is not working as it giving this error
ERR unknown command HEXPIRE, with args beginning with: exampleHash, 40, FIELDS, 1, field1,

Can anyone help in this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions